Roland (archive)
Usenet Archive
- Joined
- Jan 26, 2001
- Messages
- 284
- Reaction score
- 0
hi all
having designed my schema to use repeating groups of elements, I found that some applications (eg. Microsoft InfoPath) refused to recognised that element as a repeating element.
I subsequently found that out of the three possible ways (that I know of) of declaring repeating elements in xsd, only one of these was understood:
a) occurence constraint on the child element contained in a sequence compositor IS recognised as a repeating element. b) occurence constraint on sequence compositor containing the child element IS NOT recognised as a repeating element. c) occurence constraint on group reference where the goup is a sequence compositor containing the child element IS NOT recognised as a repeating element.
as can be seen from the following xsd schema:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="testRepeating"> <xsd:complexType> <xsd:sequence> <xsd:element name="RepeatingChildren"> <xsd:complexType> <xsd:sequence> <xsd:element ref="repeatingChild" minOccurs="0" maxOccurs="10"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="RepeatingSequence"> <xsd:complexType> <xsd:sequence minOccurs="0" maxOccurs="10"> <xsd:element ref="repeatingChild"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="RepeatingGroup" type="repeatingGroupType"> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="repeatingChild" type="xsd:string"/> <xsd:group name="repeatingGroup"> <xsd:sequence> <xsd:element ref="repeatingChild"/> </xsd:sequence> </xsd:group> <xsd:complexType name="repeatingGroupType"> <xsd:group ref="repeatingGroup" minOccurs="0" maxOccurs="10"/> </xsd:complexType> </xsd:schema>
only the "//testRepeating/RepeatingChildren/repeatingChild" XPath in a document instance based on the above schema was treated by the application as a repeating element.
ignoring that particular limitation, I would like to know which of the three models above that allow repeating elements is the most recommended approach, and why ?
thanks
roland
having designed my schema to use repeating groups of elements, I found that some applications (eg. Microsoft InfoPath) refused to recognised that element as a repeating element.
I subsequently found that out of the three possible ways (that I know of) of declaring repeating elements in xsd, only one of these was understood:
a) occurence constraint on the child element contained in a sequence compositor IS recognised as a repeating element. b) occurence constraint on sequence compositor containing the child element IS NOT recognised as a repeating element. c) occurence constraint on group reference where the goup is a sequence compositor containing the child element IS NOT recognised as a repeating element.
as can be seen from the following xsd schema:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="testRepeating"> <xsd:complexType> <xsd:sequence> <xsd:element name="RepeatingChildren"> <xsd:complexType> <xsd:sequence> <xsd:element ref="repeatingChild" minOccurs="0" maxOccurs="10"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="RepeatingSequence"> <xsd:complexType> <xsd:sequence minOccurs="0" maxOccurs="10"> <xsd:element ref="repeatingChild"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="RepeatingGroup" type="repeatingGroupType"> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="repeatingChild" type="xsd:string"/> <xsd:group name="repeatingGroup"> <xsd:sequence> <xsd:element ref="repeatingChild"/> </xsd:sequence> </xsd:group> <xsd:complexType name="repeatingGroupType"> <xsd:group ref="repeatingGroup" minOccurs="0" maxOccurs="10"/> </xsd:complexType> </xsd:schema>
only the "//testRepeating/RepeatingChildren/repeatingChild" XPath in a document instance based on the above schema was treated by the application as a repeating element.
ignoring that particular limitation, I would like to know which of the three models above that allow repeating elements is the most recommended approach, and why ?
thanks
roland