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

Re: XSD substitution groups, subtypes, nillable .. thewhole sm

  • To: xml dev <xml-dev@l...>
  • Subject: Re: XSD substitution groups, subtypes, nillable .. thewhole smack
  • From: Soren Kuula <dongfang@d...>
  • Date: Fri, 24 Feb 2006 17:51:56 +0000
  • User-agent: Mozilla Thunderbird (X11/20050322)

xsd nillable
Hi,

Ok, a little more clarification:

My ad hoc notation

 >There is a declared element with name x, with type b, and a required 
attribute xsi:type with values in {b} and >an optional attribute xsi:nil 
with values in{false}

cannot be expressed in XML Schema, because the declarations resulting 
from my translating away type inheritance would result in all sorts of 
violations:

- Translation could have more than one top level element of the same name
- Translation of local declarations could violate EDC
- Translations declare XML Schema Instance attributes.
- And maybe more.

Im just trying to express the simple, single-type** language struggling 
to get out from within XML Schema. My idea was, again, that:

-An element declared with a type extended from another type really is 
two or more declarations, with the same name, and with different types. 
They are made distinguishable, keeping the schema single-type, by 
requiring the xsi:type attribute

-An element declared nillable really is two declarations with the same 
name, one with the declared content, and one with empty content. They 
are made distinguishable, keeping the schema single-type, by requiring 
the xsi:nil attribute

-The above two combine, although I'm not quite sure how.

My ad hoc'er

 >There is a declared element with name x, with type b, and a required 
attribute xsi:type with values in {b} and >an optional attribute xsi:nil 
with values in{false}

is, in pseudo XSD: XSD without type extension, without nillable and with 
explicit declaration of xsi attributes:

<element name="x">
 <complexType>
   <complexContent>
     <sequence>
       <!-- content of type a in original schema-->
       <!-- content of type b in original schema-->
     </sequence>
   </complexContent>
   <attribute name="xsi:type" use="required">
     <simpleType>
       <restriction base="string">
         <enumeration value="b"/>
       </restriction>
     <simpleType>
   </attribute>
   <attribute name="xsi:nil" use="optional">
     <simpleType>
       <restriction base="string">
         <enumeration value="false"/>
       </restriction>
     <simpleType>
   </attribute>
 </complexType>
</element>

(I might have used fixed instead of the sinlgton type for the xsi:type 
attribute, but to stay consistent, avoid more confusion and trouble with 
declaration of a fixed, optional attribute -- that is impossble, is it 
not? -- I will just stick with singleton simple types).

Hope that clarified,

Thank you for trying to help ;)

Soren


** Single type, but not ancestor typeable. If xsi:type and xsi:nil 
attributes are considered part of the name of the element that holds 
them, then XML schema is ancestor typeable.


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.