[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

"case dependent" structures in xsd

From: Andreas Peter <info@minimag.de>
Date: Wed, 05 Nov 2008 21:03:06 +0100
Message-ID: <4911FBFA.6050502@minimag.de>
To: XML Schema List <xmlschema-dev@w3.org>
"case dependent" structures in xsd

Dear XSD-developers,

for about three days now I am trying to model the following structure 
using XMLSchema. But unfortunately I am going more and more insane with 
this issue.

Here are the desired outputs in two versions:

<!-- Possibility 2 -->
<cbox1>
        <AUD_cbox1_title_icon/>
        <AUD_cbox1_title/>
        <AUD_cbox_h1_after_boxtitle/>
        <AUD_cbox_body/>
        <AUD_cbox_h1/>
        <AUD_cbox_body/>
        <AUD_cbox_body/>
        <AUD_cbox_h2/>
        <AUD_cbox_body/>
        <AUD_cbox_h1/>
        <AUD_cbox_h2_after_h1/>
        <AUD_cbox_body/>
        <AUD_cbox_body/>
        <AUD_cbox_h2/>
        <AUD_cbox_body/>
        <!-- and so on -->
</cbox1>

<!-- Possibility 2 -->
<cbox1>
        <AUD_cbox_h1/>
        <AUD_cbox_h2_after_h1/>
        <AUD_cbox_body/>
        <AUD_cbox_body/>
        <AUD_cbox_h2/>
        <AUD_cbox_body/>
        <AUD_cbox_h1/>
        <AUD_cbox_h2_after_h1/>
        <AUD_cbox_body/>
        <!-- and so on -->
</cbox1>


And this is my current XSD. But as I said I am trying for about three 
days without any good idea.

<xs:element name="cbox1">
        <xs:complexType>
            <xs:choice>
                <xs:sequence minOccurs="0">
                    <xs:element name="AUD_cbox1_title_icon"/>
                    <xs:element name="AUD_cbox1_title"/>
                </xs:sequence>
                <xs:choice>
                    <xs:element name="AUD_cbox_h1_after_boxtitle" 
minOccurs="0"/>
                    <xs:element name="AUD_cbox_h1"/>
                    <xs:element name="AUD_cbox_h2"/>
                    <xs:element name="AUD_cbox_h2_after_h1"/>
                </xs:choice>
                <xs:choice>
                    <xs:element name="AUD_cbox_body"/>
                    <xs:element name="AUD_cbox_list_alphanum_level_1"/>
                    <xs:element name="AUD_cbox_list_alphanum_level_2"/>
                    <xs:element name="AUD_cbox_list_alphanum_level_3"/>
                    <xs:element name="AUD_cbox_list_symbols_level_1"/>
                    <xs:element name="AUD_cbox_list_symbols_level_2"/>
                    <xs:element name="AUD_cbox_list_symbols_level_3"/>
                </xs:choice>
            </xs:choice>
        </xs:complexType>
    </xs:element>

Especially the <AUD_cbox_h1_after_boxtitle/> and 
<AUD_cbox_h2_after_h1"/> are the biggest problems for me.

I don´t know if such "case dependent structures" are possible using XSD. 
Perhaps the solution will be to use a different language. This will be a 
suitable answer, too.

I hope everything is understandable.


Thanks in advance,
Andreas
Received on Wednesday, 5 November 2008 20:04:11 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.