[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: redefining enumeration?
Prasad G S K <prasadg@a...> writes: > Can I redefine 'enumeration' element in the XSD I write? > > I want the 'enumeration' element defined at http://www.w3.org/2001/XMLSchema > <http://www.w3.org/2001/XMLSchema> namespace to hold some other custom > element i.e., > I should be able to write as follows in my instance document. > > <simpleType name="MyType"> > <restriction base="string"> > <enumeration value="ABC"> > <MyElement value="xxx"/> > </enumeraion> > </restriction> > </simpleType> No. The type definitions of most of the elements and attributes in the W3C XML Schema namespace are defined with blockDefault='#all', meaning that you cannot use anything other than the expected types for those elements. However there is a place where you are allowed to put your extensions, namely the appInfo element: <simpleType name="MyType" xmlns:my="http://www.example.org/Prasad/Extension"> <restriction base="string"> <enumeration value="ABC"> <annotation> <appInfo> <my:Element value="xxx"/> </appInfo> </annotation> </enumeraion> </restriction> </simpleType> -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh Half-time member of W3C Team 2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@c... URL: http://www.ltg.ed.ac.uk/~ht/ [mail really from me _always_ has this .sig -- mail without it is forged spam]
|
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
|