Creating a Schema With two occurrences of the same componen
Posted: Mon Aug 13, 2007 1:18 pm
Hello all,
Hope you could help me.
I have to validate an XML file using an XSD schema.
The problem is that the XML contains the same name, "isavail ", in 2 different uses.
I can't change the XML, how can I validate it?
My XML file looks like this:
My XSD schema looks like this:
when i try validating it i get this message:
sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of ',isavail'.
Any suggestions?
Thanks,
Carol
Hope you could help me.
I have to validate an XML file using an XSD schema.
The problem is that the XML contains the same name, "isavail ", in 2 different uses.
I can't change the XML, how can I validate it?
My XML file looks like this:
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" ?>
<isavail rc="0" service="invitation">
< isavails>
< isavail invid="64834" status="valid"/>
</ isavails>
</ isavail >
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSpy v2007 sp2 (http://www.altova.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name=" isavails ">
<xs:complexType>
<xs:sequence>
<xs:element ref=" isavail"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name=" isavail">
<xs:complexType>
<xs:sequence>
<xs:element ref=" isavails" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="status" type="xs:string"/>
<xs:attribute name="service" type="xs:string"/>
<xs:attribute name="rc" type="xs:int"/>
<xs:attribute name="invid" type="xs:long"/>
</xs:complexType>
</xs:element>
</xs:schema>
when i try validating it i get this message:
sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of ',isavail'.
Any suggestions?
Thanks,
Carol