Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: "case dependent" structures in xsd

From: "Michael Kay" <mike@--------.--->
To: <info@-------.-->, "'XML Schema List'" <xmlschema-dev@--.--->
Date: 11/5/2008 11:16:00 PM

It might or might not be possible to define the structure that you want. One
really can't tell what that structure is, though, from just two samples.
It's like telling us that you want to model the grammar of the two English
sentences "I like baked beans" and "Do you like jam?".

It might be that other readers are better at pattern recognition than I am,
and can see from your two examples what rules you have in mind. But I can't.
It's always possible to permit both these sequences by a structure that
allows all the child elements in any order, but I guess you want something
less permissive than that.

Michael Kay
http://www.saxonica.com/ 


> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Andreas Peter
> Sent: 05 November 2008 20:03
> To: XML Schema List
> Subject: "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
> 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent