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

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
	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">
	<element name="brain"/>
	<attribute name="att1" type="string">
	<attribute name="att2" type="string">
<complexType name="CT2">
	<attribute name="href" type="anyURI">
	<attribute name="path" type="string">
Received on Wednesday, 28 August 2002 11:25:42 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:58 UTC