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

Re: Ignore Order while validating XSD

From: C. M. Sperberg-McQueen <cmsmcq@acm.org>
Date: Mon, 26 Jan 2009 12:12:33 -0700
Message-Id: <FD169D6C-DA83-49BE-9CB8-8D395E0AC8CE@acm.org>
Cc: "C. M. Sperberg-McQueen" <cmsmcq@acm.org>, xmlschema-dev@w3.org
To: Eduardo Oliveira <eduardo.oliveirared@gmail.com>
Re: Ignore Order while validating XSD


On 26 Jan 2009, at 09:08 , Eduardo Oliveira wrote:

> ...
> Even, I have a problem because I can not limit the repeating size  
> because the elements are inside an unbounded size choice element,  
> isn“t it?

Correct.  XSD 1.1 may be helpful to you here (so make sure your vendors
know you would like to see it supported), because it will allow you to
express

>
> Another problem I had is using xs:all inside the xs:group cause an  
> error. Is it not possible?

No, all-groups complicate matters a great deal when they are allowed
inside of other group types.  It's not the occurrence of xsd:all inside
the model group definition that is forbidden, but the use of that
defined all-group inside a sequence.  So what you want may be more like
this:


  <xsd:group name="bcx">
   <xsd:choice>
    <xsd:element ref="my:b" />
    <xsd:element ref="my:c" />
    <xsd:element ref="my:x" />
   </xsd:choice>
  </xsd:group>

  <xsd:complexType name="oliveira">
   <xsd:sequence>
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
     <xsd:group ref="my:bcx"/>
    </xsd:choice>
    <xsd:element ref="my:a" />
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
     <xsd:element ref="my:a" />
     <xsd:group ref="my:bcx"/>
    </xsd:choice>
   </xsd:sequence>
  </xsd:complexType>

I hope this helps.


-- 
C. M. Sperberg-McQueen, W3C XML Activity
http://www.w3.org/People/cmsmcq
http://cmsmcq.com/mib/
http://www.balisage.net/
Received on Monday, 26 January 2009 19:12:28 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.