xml schema extended data types

LostProgrammer

Well-known member
Joined
Jan 17, 2003
Messages
123
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
 
Back
Top