[
Lists Home |
Date Index |
Thread Index
]
- To: xml dev <xml-dev@lists.xml.org>
- Subject: Re: [xml-dev] XSD substitution groups, subtypes, nillable .. thewhole smack
- From: Soren Kuula <dongfang@dongfang.dk>
- Date: Fri, 24 Feb 2006 17:51:56 +0000
- User-agent: Mozilla Thunderbird (X11/20050322)
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.
|