Re: Could anyone explain this schema structure?
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Fri, 25 Nov 2005 13:27:00 +0100
wesley.hall@xxxxxxxxx wrote:
"<xs:element name="shoesize"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:integer"> <xs:attribute name="country" type="xs:string" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element>"
What I dont understand here is the location of the xs:attribute element
in the schema. It seems to suggest that the attribute is a child of the
character data value (xs:extension).
What you see is an anonymous type definition of a complex type for an element that has a simple content but an attribute.
If you want to have an element have attributes then in terms of the W3C XML schema language that element always has a complex type, even if its content is empty or a simple content. So in terms of the type system the simple base type xs:integer is extended to define a complex type with simple element contents and one attribute.
You might not like it but that is the way it is supposed to happen in that schema language:
<http://www.w3.org/TR/xmlschema-1/#Type_Derivation>
--
Martin Honnen http://JavaScript.FAQTs.com/ .
- Follow-Ups:
- Re: Could anyone explain this schema structure?
- From: Wesley Hall
- Re: Could anyone explain this schema structure?
- References:
- Could anyone explain this schema structure?
- From: wesley . hall
- Could anyone explain this schema structure?
- Prev by Date: Re: Experience with XML DataBases
- Next by Date: Re: Could anyone explain this schema structure?
- Previous by thread: Could anyone explain this schema structure?
- Next by thread: Re: Could anyone explain this schema structure?
- Index(es):
Relevant Pages
|