W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2003

Re: xs:union alternative

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 17 Jun 2003 17:09:22 +0100
To: "Tony Yip" <tony.yip@softwareag.com>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5bwufk8z4d.fsf@erasmus.inf.ed.ac.uk>

"Tony Yip" <tony.yip@softwareag.com> writes:

> I am seeking any alternative to replace xs:union. Suppose I have an
> element which allow the following contents - "UTF-8", "GB2312" & any
> String.
> Normally, I can create 2 simpleTypes (one for "any String" and one
> for pre-defined values) and using xs:union. Is there any alternative
> that I can define 1 simpleType to solve the problem.

Since the values you allow are themselves strings, you could just use
xs:string, right?  The only downside would be that you would not get
whitespace normalization.  If you want that, and don't mind _always_
having it, just use xs:token.

  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Tuesday, 17 June 2003 12:09:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:11 UTC