W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2002

Element with two attribute groups

From: Marcos Mayorga <marcos.mayorga@grupotecnobit.com>
Date: Wed, 28 Aug 2002 09:41:23 -0400 (EDT)
Message-ID: <9AC7CD9DDB1E7441A6B54B0E7F9B8E3D28EA71@gtalc002sw2000.grupotecnobit.local>
To: <xmlschema-dev@w3.org>





I need to define the schema for validating the following xml document:

<something att1="1" att2="2">
	<brain>no<brain>
</something>

and also the element 'something' can be expresed as:

<something href="any uri" path="root/one/two"/>


I need subclass the element 'something' to be
	a Complextype which defines att1,att2 and brain items, say CT1
	and
	a complextype which defines href,path attributes, say CT2
but not both at the same time.

The parser can find 'something' one time as CT1 and other time as CT2

How can implement it on XML Schema?






<element name="something" type="?">
<complexType name="CT1">
	<all>
	<element name="brain"/>
	</all>
	<attribute name="att1" type="string">
	<attribute name="att2" type="string">
</complexType>
<complexType name="CT2">
	<attribute name="href" type="anyURI">
	<attribute name="path" type="string">
</complexType>
Received on Wednesday, 28 August 2002 11:25:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT