W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2008

problem with occurence of elements

From: Andreas Peter <info@minimag.de>
Date: Sun, 09 Mar 2008 23:35:00 +0100
Message-ID: <47D46614.6000107@minimag.de>
To: XML Schema List <xmlschema-dev@w3.org>

Hello schema-users,

I have as I hope a very simple problem. Unfortunately not for me:

This is my complexType:

    <xs:complexType name="chapterType">
        <xs:sequence>
            <xs:element name="title"/>
                <xs:choice>
                    <xs:element name="subtitle"/>
                    <xs:element name="author"/>
                    <xs:element name="para"/>
                    <xs:element name="sect1"/>
                </xs:choice>
        </xs:sequence>
    </xs:complexType>

I try to realise, that after the required title-element the author-, 
para- and sect1-element can occure unboundedly and the subtitle-element 
can occure only once. There should also be the restriction that if an 
sect1-element occures the para-, author- or subtitle-element should not 
occure.

Is this possible using schema? I would be very thankful for every hint 
solving my problem.

Andreas
Received on Sunday, 9 March 2008 22:35:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:02 GMT