Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...