LostProgrammer Posted April 24, 2006 Posted April 24, 2006 i need to define custom DataTypes with an xml schema. Each DataType will have a name element and needs to extend from a base type. How do you define an element that extends from any one of the primitive types? example instance document: <DataType><Name>Integer<\Name><Extends>xs:integer<\Extends> <DataType><Name>String<\Name><Extends>xs:string<\Extends> ?schema: <xs:complexType name="DataType"> <xs:sequence> 'Define Name Element <xs:element name="Name" type="xs:string"></xs:element> 'Define Extends Element <xs:element name="Extends" type="ExtendedType"></xs:element> or something like ...... <xs:extension base="any of the base types (integer, string, date, ...) </xs:sequence> </xs:complexType> <xs:complexType name="ExtendedType"> <xs:choice> <xs:extension base="xs:string"></xs:extension> <xs:extension base="xs:integer"></xs:extension> <xs:extension base="xs:date"></xs:extension> </xs:choice> </xs:complexType> any ideas welcome and appreciated, thanks, -lp Quote
LostProgrammer Posted April 25, 2006 Author Posted April 25, 2006 well, i know the explanation isn't much good but here's a great link to the kinds of things i was talking about http://www.xfront.com/VariableContentContainers.html specifically Method 3: Implementing variable content containers using an abstract type and type substitution Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.