[XML] Element '---' should be un-qualified
Bonjour,
Je suis confronté à ce problème, et d'après google, c'est une histoire de namespace.
Malgré tout je ne suis pas plus avancé.
Auriez vous déjà rencontré ce problème? Où est mon erreur?
Voici un bout de code:
Code:
1 2 3 4 5 6 7
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<FAC xmlns="http://"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http:// file://D:\fac.xsd">
<test>5</test>
</FAC> |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://"
xmlns="http://"
version="1.0">
<xsd:element name="FAC">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="test" minOccurs="0" maxOccurs="unbounded" type="lol_c"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="lol_c"> <xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema> |
Erreur deStylus: Element 'test' should be un-qualified
Merci pour vos réponses.
Billy
ça fonctionne bien avec Xalan
Bonjour,
partie XML ::
Code:
1 2 3 4 5 6 7
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<FAC xmlns="http://test"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://test test.xsd">
<test>5</test>
</FAC> |
partie Schéma ::
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://test"
xmlns="http://test"
elementFormDefault="qualified"
version="1.0"
>
<xsd:element name="FAC">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="test" minOccurs="0" maxOccurs="unbounded" type="lol_c"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="lol_c">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema> |
Ca fonctionne bien avec ce petit rajout :: elementFormDefault="qualified"
Pour le sens, il faudra repasser par un expert, cela indique si les éléments XML doivent être qualifiés par un espace de noms.
Voilà,
Xavier