J
John Jørgensen
Hi
How do I express - in XSD - that an element can contain a sequenced
list of elements, and one of these elements may occur (0-n times) at
BOTH sequence position x AND y?
Example:
<PRIORITY sorting="900"/>
<NAMEINFO>
subtags and data
</NAMEINFO>
<EXTRA_LINE>
subtags and data
</EXTRA_LINE>
<EXTRA_LINE>
subtags and data
</EXTRA_LINE>
<ADDRINFO>
subtags and data
</ADDRINFO>
<PHONEINFO>
subtags and data
</PHONEINFO>
<EXTRA_LINE>
subtags and data
</EXTRA_LINE>
Currently, my schema looks something like:
<xs:complexType>
<xs:sequence>
<xs:element name="PRIORITY" maxOccurs="1" minOccurs="1">
blablabla
</xs:element>
<xs:element name="NAMEINFO" minOccurs="0">
blablabla
</xs:element>
<xs:element name="LOGO" minOccurs="0">
blablabla
</xs:element>
<xs:element name="EXTRA_LINE" maxOccurs="10" minOccurs="0">
blablabla
</xs:element>
<xs:element name="ADDRINFO">
blablabla
</xs:element>
<xs:element name="PHONEINFO">
blablabla
</xs:element>
<xs:element name="EXTRA_LINE" maxOccurs="10" minOccurs="0">
blablabla
</xs:element>
</xs:complexType>
</xs:element>
Validation says: Duplicated definition for: 'EXTRA_LINE'
I know I can just rename one of my EXTRA_LINE groups or add an extra
level somewhere, but I'm not too keen on that...
Any suggestions?
Regards
/John
How do I express - in XSD - that an element can contain a sequenced
list of elements, and one of these elements may occur (0-n times) at
BOTH sequence position x AND y?
Example:
<PRIORITY sorting="900"/>
<NAMEINFO>
subtags and data
</NAMEINFO>
<EXTRA_LINE>
subtags and data
</EXTRA_LINE>
<EXTRA_LINE>
subtags and data
</EXTRA_LINE>
<ADDRINFO>
subtags and data
</ADDRINFO>
<PHONEINFO>
subtags and data
</PHONEINFO>
<EXTRA_LINE>
subtags and data
</EXTRA_LINE>
Currently, my schema looks something like:
<xs:complexType>
<xs:sequence>
<xs:element name="PRIORITY" maxOccurs="1" minOccurs="1">
blablabla
</xs:element>
<xs:element name="NAMEINFO" minOccurs="0">
blablabla
</xs:element>
<xs:element name="LOGO" minOccurs="0">
blablabla
</xs:element>
<xs:element name="EXTRA_LINE" maxOccurs="10" minOccurs="0">
blablabla
</xs:element>
<xs:element name="ADDRINFO">
blablabla
</xs:element>
<xs:element name="PHONEINFO">
blablabla
</xs:element>
<xs:element name="EXTRA_LINE" maxOccurs="10" minOccurs="0">
blablabla
</xs:element>
</xs:complexType>
</xs:element>
Validation says: Duplicated definition for: 'EXTRA_LINE'
I know I can just rename one of my EXTRA_LINE groups or add an extra
level somewhere, but I'm not too keen on that...
Any suggestions?
Regards
/John