W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2010

Sequence of elements of same name but various types

From: <allamistakeo18@mac.com>
Date: Wed, 14 Apr 2010 08:39:47 +0200
Message-id: <29AA6B3D-F1E8-453F-B303-EFEC3B616F0B@mac.com>
To: xmlschema-dev@w3.org
Hi there, 

I am trying to write an XSD file for an existing XML-based file format. The format represents a list of elements, each element being either in the following format: 

<item flavor="text">
	some text

or in the following format: 

<item flavor="elements">
	<elem />

In other words, all elements are named "item", but their allowed content depends on the value of the attribute "flavor". If flavor="text", the content must be text that satisfies some regular expression, and if flavor="elements", the content must be an element named "elem". 

Is there a way to write an XSD file for this format? Or is it just not possible because of the Unique Particle Attribution constraint? 

Thanks in advance for your help 
Received on Wednesday, 14 April 2010 08:32:27 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:17 UTC