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

Re: using xs:choice inside xs:all

From: George Cristian Bina <george@oxygenxml.com>
Date: Tue, 10 Jan 2006 12:10:26 +0200
Message-ID: <43C38812.6020708@oxygenxml.com>
To: Mahesh Vittal <mvittal@gmail.com>
CC: xmlschema-dev@w3.org
xml schema elements without ordering

Hi Mahesh,

You cannot have xs:choice inside of xs:all.
I think it may be possible to write the content model to match your 
requirements with choice and sequence but that may be complex.
If Schematron does not scare you :) then you may use Schematron embedded 
rules to enforce your constraints and relax the content model in the XML 
Schema to a choice between your possible elements.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Mahesh Vittal wrote:
> Hi ,
> 
> I am trying for an XML Schema which would achieve the following 
> functionality...
> 
> [1]  Atleast one or both of "element1" or "element2" can occur
> [2]  Atleast one or a combination of <element3>....<element5>
> [3]  <element1> ....<element<5> can occur in any order.
> 
> <Root-element>
>    <element1>a</element1>
>    <element2>b</element2>
>    <element3>c<element3>
>    <element4>d<element4>
>    <element5>e<element5>
> </Root-element>
> 
> I was able to achieve [1] & [2] by using a <xs:choice 
> maxOccurs="unbounded"> for the two sets of elements and arrange it 
> inside a <xs:sequence> but the functionality I want is without ordering. 
> Any help on this is appreciated.
> 
> Regards,
> Mahesh
> 
> 
> 
> 
Received on Tuesday, 10 January 2006 10:07:07 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.