Jump to content

Restrictions for extended types?


Guest Moebius
 Share

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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...