W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

Generating dynamic "choice" content

From: Piccand Régis <regis.piccand@imtf.ch>
Date: Mon, 3 Dec 2001 12:20:38 +0100
Message-ID: <DF7EC83D7AFBD411965B0008C7596EC53ED48C@imtfexchange.imtf.ch>
To: xmlschema-dev@w3.org
Hi all,

I'm pretty new to XML-schema and am wondering about dynamical generation of
schemas.

Let's assume I want to dynamically fill or add new elements in a choice
list, as follows :

<!-- extract from XML Schemas tutorial - Roger Costello - available at
http://www.xfront.com/-->
<xsd:element name="transportation">
	<xsd:complexType>
		<xsd:choice>
			<xsd:element name="train" type="xsd:string"/>
			<xsd:element name="plane" type="xsd:string"/>
			<xsd:element name="automobile" type="xsd:string"/>
			...
		</xsd:choice>
	</xsd:complexType>
</xsd:element>

The "choice" elements (train, plane, automobile) should be read from a DB
and dynamically added ; the complete element definition (type, minOccurs,
maxOccurs, etc.) would be read from the DB too.

What options do I have to achieve this ? 

For now, the only option I see is to programmatically generate a schema for
this type and then ref it from my main schema.

I would be very grateful if any of you could give me some "pointers" to
available documents/products involving dynamic generation of schemas.

Thanks a lot in advance for your help and best regards

Régis
Received on Monday, 3 December 2001 06:26:40 GMT

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