- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: 29 Aug 2000 16:36:15 +0100
- To: Ian Stokes-Rees <ian@decisionsoft.com>
- Cc: xsdl <xmlschema-dev@w3.org>
Ian Stokes-Rees <ian@decisionsoft.com> writes: > Here is a sample instance document: > > <fruit>apple</fruit> > > The XSD for it looks like: > > <element name="fruit> > <simpleType base="string"> > <enumeration name="apple"/> > <enumeration name="orange"/> > <enumeration name="peach"/> > </simpleType> > </element> > > As you would expect, very straight forward. The enumerated list > {apple,organge,peach} only ever occurs inside of the "fruit" element, so > the simpleType is declared annonymously. Now take a second example: > > <fruit source="Canada">apple</fruit> > > Source is some string > > Following the format of the above schema fragment, one would naively > expect the following to work: > > <element name="fruit"> > <complexType base="string" deriveBy="extension"> > <attribute name="source" type="string"/> > <enumeration name="apple"/> > <enumeration name="orange"/> > <enumeration name="peach"/> > </complexType> > </element> <snip/> The WG has approved a change to the syntax which allows nesting anonymous simple types in the case, which will look something like this: <element name="fruit" xmlns="http://www.w3.org/2000/08/XMLSchema"> <complexType> <simpleContent> <extension> <simpleType> <restriction base="string"> <enumeration value="apple"/> <enumeration value="orange"/> <enumeration value="peach"/> </restriction> </simpleType> <attribute name="source" type="string"/> </extension> <simpleContent> </complexType> </element> ht -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh W3C Fellow 1999--2001, part-time member of W3C Team 2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/
Received on Tuesday, 29 August 2000 11:36:18 UTC