xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ankit Pasricha <ank...@ca.ibm.com>
Subject Re: XML Schema
Date Mon, 23 Aug 2004 14:08:25 GMT




Another thing u can try is the following:


<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="father" type="xs:string"/>
    <xs:element name="mother" type="xs:string"/>
    <xs:element name="son" type="xs:string"/>
    <xs:element name="daughter" type="xs:string"/>
    <xs:element name="pet" type="xs:string"/>

    <xs:element name="family">
        <xs:complexType>
            <xs:sequence>
                  <xs:choice minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="father"/>
                        <xs:element ref="mother"/>
                        <xs:element ref="son"/>
                        <xs:element ref="daughter"/>
                        <xs:element ref="pet"/>
                  </xs:choice>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

That will allow multiple sets of parents but allows any order.


Ankit Pasricha
XML Parser Development
IBM Toronto Lab
8200 Warden Avenue, Ontario L6G 1C7
Phone: (905) 413 4941


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Mime
View raw message