🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.text.xml
Article #117

différence entre deux schémas

#117
From: thierry
Date: Sun, 08 Nov 2009 20:48
55 lines
2496 bytes
Bonjour,

J'aimerais comprendre la différence entre

<?xml version="1.0" encoding="iso-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
			targetNamespace="http://domaine.tld"
			xmlns="http://domaine.tld">

	<xsd:element name="serveur" type="xsd:string" />
	<xsd:element name="definition">
		<xsd:complexType>
			<xsd:all>
				<xsd:element ref="serveur" minOccurs ="1" maxOccurs ="1" />
			</xsd:all>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>

qui valide

<?xml version="1.0" encoding="utf-8"?>
<definition xmlns="http://domaine.tld">
  <serveur>serveur1</serveur>
</definition>

ET

<?xml version="1.0" encoding="iso-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
			targetNamespace="http://domaine.tld"
			xmlns="http://domaine.tld">

	<xsd:element name="definition">
		<xsd:complexType>
			<xsd:all>
				<xsd:element name="serveur" minOccurs ="1" maxOccurs ="1" />
			</xsd:all>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>

qui valide

<?xml version="1.0" encoding="utf-8"?>
<definition xmlns="http://domaine.tld">
  <serveur xmlns="">anyType</serveur>
</definition>

La différence étant que dans le deuxième cas la balise serveur semble
avoir besoin d'un attribut xmlns.

Merci d'avance pour vos avis éclairés

thierry
Technical Details
Message-ID: <9f67f1f9-f6e2-44ff-9f27-e422c0f83f46@z41g2000yqz.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!z41g2000yqz.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!z41g2000yqz.googlegroups.com!not-for-mail
From: thierry <thierry.schmit@gmail.com>
Newsgroups: fr.comp.text.xml
Subject: différence entre deux schémas
Date: Sun, 8 Nov 2009 12:48:19 -0800 (PST)
Organization: http://groups.google.com
Lines: 55
Message-ID: <9f67f1f9-f6e2-44ff-9f27-e422c0f83f46@z41g2000yqz.googlegroups.com>
NNTP-Posting-Host: 82.247.74.151
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1257713299 24374 127.0.0.1 (8 Nov 2009 20:48:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 8 Nov 2009 20:48:19 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: z41g2000yqz.googlegroups.com; posting-host=82.247.74.151; 
 posting-account=HRiyEAoAAADzxR7ZSVTOF3n8lWeLP_BU
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.15) 
 Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)