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

xs:choice and xs:sequence question

From: David Carver <d_a_carver@yahoo.com>
Date: Wed, 11 Jan 2006 10:37:35 -0500
Message-ID: <43C5263F.1090409@yahoo.com>
To: xmlschema-dev@w3.org
xs choice

I have the following complexType coded:

   <xs:complexType name="ProcessingOutcomeMessage">
       <xs:choice>
           <xs:sequence>
               <xs:element ref="DescriptionMessage" minOccurs="0" 
maxOccurs="unbounded" />
               <xs:element ref="MessageReasonCode" minOccurs="0" />
           </xs:sequence>
           <xs:sequence>
               <xs:element ref="DescriptionMessage" type="Description" 
minOccurs="1" maxOccurs="unbounded" />
               <xs:element ref="MessageReasonCode" 
type="MessageReasonCode" minOccurs="1" />
               <xs:element ref="ApplicationReasonCode" 
type="ApplicationReasonCode" minOccurs="1">
                   <xs:annotation>
                       <xs:documentation 
source="http://www.starstandard.org">Contains a software specific 
application reason code.</xs:documentation>
                   </xs:annotation>
               </xs:element>
           </xs:sequence>
       </xs:choice>
   </xs:complexType>

It validates fine if using Xerces J 2.7.0 or XSV 2.5.  However, 
Microsoft's XML, XML Spy 2006 SP2, and Oxygen complain about 
DescriptionMessage being defined twice, even though they are in seperate 
sequence groups.

What I want to do is require DescriptionMessage, MeassageReasonCode if 
there is an ApplicationReasonCode, if there isn't an 
ApplicationReasonCode, then DescriptionMessage and MessageReasonCode are 
optional.

Any help would be appreciated.

Thanks.

Dave
Received on Thursday, 12 January 2006 04:16:39 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.