I’m trying to create an XDS for an XML to describe a family. In this instance you can have the following
<family>
<DadsName>Fred</DadsName>
<MumsName>Wilma</MumsName>
<child>
<childName>pebbles</childName>
</child>
<child>
<childName>BamBam</childName>
</child>
</family>
In this msg the mum/dad names can come in any order, and some times they are optional -> This is important
I’ve created the following XSD..
<xs:element name="family">
<xs:complexType>
<xs:all>
<xs:element name="DadsName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="MumsName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="child" maxOccurs="unbounded" >
<xs:complexType>
<xs:sequence>
<xs:element name="childName" type="xs:string"/>
<xs:element name="childAge" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
I specifically added the <xs:all>
as the ordering can of Mum and Dad can be jumbled.
Is this correct? I get the error ‘the value unBounded is invalid in a group’
New contributor
JPO is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.