[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSD substitution groups, subtypes, nillable .. thewhole sm
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|