OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] xs:choice question...

[ Lists Home | Date Index | Thread Index ]

Why not just:
 
                        <xs:choice> 
                           <xs:sequence>
                                        <xs:element name="A" minOccurs="1"/>
                                        <xs:element name="B" minOccurs="0"/> 
                           </xs:sequence> 
                           <xs:element name="B" minOccurs="1"/> 
                        </xs:choice> 

Hope that helps,
Priscilla
 

-----------------------------------------------------------------
Priscilla Walmsley                 http://www.datypic.com
Author, Definitive XML Schema     (Prentice Hall PTR) 
            Definitive XQuery (coming in 2006)
-----------------------------------------------------------------

 


From: Brian J Gentry [mailto:Brian.j.Gentry@tntlogistics.com]
Sent: Monday, January 16, 2006 12:36 PM
To: xml-dev@lists.xml.org
Subject: [xml-dev] xs:choice question...


Hello,
         I have a schema that needs to require 1 of 2 elements, but also allow for both of them. So if the elements are A & B, then A alone is valid, B alone is valid, A & B are valid, but ~A & ~B is invalid.

I tried the following..

                        <xs:choice>
                         <xs:sequence>
                                        <xs:element name="A" minOccurs="1"/>
                                        <xs:element name="B" minOccurs="0"/>
                         </xs:sequence>
                         <xs:sequence>
                                        <xs:element name="A" minOccurs="0"/>
                                        <xs:element name="B" minOccurs="1"/>
                         </xs:sequence>
                        </xs:choice>

But this is not working as it makes the model non-deterministic.  Is there a way to solve this?

Thanks for your time and kind regards,
Brian Gentry




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS