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

RE: Question on XSD elements in groups

From: Michael Kay <mike@saxonica.com>
Date: Mon, 23 Jun 2008 10:09:16 +0100
To: "'Arshad Noor'" <arshad.noor@strongauth.com>, <xmlschema-dev@w3.org>
Message-ID: <99FD4E81BFB64528A2E8A3C2FB801BFF@Sealion>
RE: Question on XSD elements in groups

Even though the two particles referring to ekmi:Symkey are effectively
identical, the rules are that an instance element must be attributable to
one of the particles unambiguously.

The solution is to use the content model (a b? | b) in place of (a | b | ab)

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

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Arshad Noor
> Sent: 22 June 2008 00:36
> To: xmlschema-dev@w3.org
> Subject: Question on XSD elements in groups
> 
> 
> I have the following defined in an XSD:
> 
> 
> <xsd:element name="Symkey" type="ekmi:SymkeyType"/> 
> <xsd:element name="SymkeyError" type="ekmi:SymkeyErrorType"/>
> 
> <xsd:group name="SymkeyWithSymkeyErrorGroup">
>      <xsd:sequence>
>         <xsd:element ref="ekmi:Symkey"/>
>         <xsd:element ref="ekmi:SymkeyError"/>
>      </xsd:sequence>
> </xsd:group>
> 
> 
> I'm trying to define a complex type that has a choice of 
> either the Symkey or the SymkeyError elements, or the 
> above-defined group which includes both elements.
> 
> However, the tool I'm using to build the schema keeps giving 
> me the following error:
> 
> Error: cos-nonambig: "http://docs.oasis-open.org/ekmi/2008/01":Symkey
> and "http://docs.oasis-open.org/ekmi/2008/01":Symkey (or 
> elements from their substitution group) violate "Unique 
> Particle Attribution". During validation against this schema, 
> ambiguity would be created for those two particles.
> 
> Since I can only have a Symkey, SymkeyError or a combination 
> of both in the to-be-defined element, why does NB think there 
> will be ambiguity?  How do I go about accomplishing what I 
> want?  Thanks in advance.
> 
> Arshad Noor
> StrongAuth, Inc.
> 
> 
> 
> 
> 
Received on Monday, 23 June 2008 09:09:54 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.