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

Conditional typing

From: Piccand Régis <regis.piccand@imtf.ch>
Date: Mon, 11 Feb 2002 10:17:58 +0100
Message-ID: <DF7EC83D7AFBD411965B0008C7596EC53ED578@imtfexchange.imtf.ch>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hi all,

I'm trying to write a schema which allows an element to be of different
types, depending on the value of an attribute.

In details, I'm describing an electronic document, which <content> can be
either base64 binary or textual. Up to now, I used two different elements
that where in a choice section, like follows :

		<xs:element name="binary" type="xs:base64Binary"/>
		<xs:element name="text" type="xs:string"/>

Now, I'd like to use an attribute to say whether the content is bases64 or

	<xs:element name="test">
			<xs:attribute name="type" use="required">
					<xs:restriction base="xs:string">

- Is this possible to do that in the actual version of xmlschema ?
- If not, is it planned to allow this kind of functionality ?
- Is it recommended to use "non-standard" schema languages (schematron ??) ?

Thanks in advance for your advices.

Received on Monday, 11 February 2002 04:25:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:59 UTC