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

Same element, different type

  • From: Keith Hassen <keith.hassen@g...>
  • To: xml-dev@l...
  • Date: Thu, 29 Jan 2009 14:12:52 -0500

Same element
Hi,

I have what I suspect is a simple question about element consistency in 
a schema.  I have recently run across a few scenarios that require me to 
define something like the following:

   <xs:element name="params">
     <xs:complexType>
       <xs:sequence>
         <xs:element minOccurs="1" maxOccurs="1" name="param">
           <xs:simpleType>
             <xs:restriction base="xs:string">
               <xs:enumeration value="a"/>
               <xs:enumeration value="b"/>
               <xs:enumeration value="c"/>
             </xs:restriction>
           </xs:simpleType>
         </xs:element>
         <xs:element minOccurs="1" maxOccurs="1" name="param" 
type="xs:string"/>
       </xs:sequence>
     </xs:complexType>
   </xs:element>

The definition above isn't ambiguous (which would break the unique 
particle attribution rule), but it is not *consistent* vis-a-vis the 
types.  The Xerces parser reports a "cos-element-consistent" error, 
which I understand, but which I am hoping to circumvent while 
maintaining strict parsing rules.

Is there a way to define two unambiguous elements with the same name but 
are of different types?  I believe the answer here is "it can't be 
done", but thought I'd throw this at the wolves to see if I'm right. :)

(Incidentally, the above example is a snippet from a schema that is 
attempting a representation of an XML-RPC message set, where the first 
parameter is always a constrained list of possible values, while the 
second parameter is any string).

-K


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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-2013 All Rights Reserved.