Jump to content

Restrictions for extended types?

Guest Moebius

Recommended Posts

Guest Moebius

Hi all,I have a schema with roughly the following structure:

<xs:complexType name="Parent" abstract="true">	<xs:sequence>		...	</xs:sequence></xs:complexType><xs:complexType name="A">	<xs:complexContent>		<xs:extension base="Parent">			<xs:sequence>				...			</xs:sequence>		</xs:extension>	</xs:complexContent></xs:complexType><xs:complexType name="B">	<xs:complexContent>		<xs:extension base="Parent">			<xs:sequence>				...			</xs:sequence>		</xs:extension>	</xs:complexContent></xs:complexType><xs:complexType name="C">	<xs:complexContent>		<xs:extension base="Parent">			<xs:sequence>				...			</xs:sequence>		</xs:extension>	</xs:complexContent></xs:complexType><xs:complexType name="Test">	<xs:sequence>		<xs:element name="X" type="Parent"/>		<xs:element name="Y" type="Parent"/>	</xs:sequence></xs:complexType>

With this schema both attributes "X" and "Y" within type "Test" could be any of the (non-abstract) derived types of type "Parent", namely "A", "B", or "C".Now I need to specify a restriction in the sense of "X may only be of types A or B while Y may only be of types A or C".My problem is that I don't know whether this is even possible with a schema and how it could be done.Any help would be appreciated.

Link to post
Share on other sites

Join the conversation

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

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...