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

Re: attemting to create a mutli-type element

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: Thu, 04 Dec 2003 09:08:43 +0000
To: "London ." <epsilonknot@hotmail.com>
Cc: xmlschema-dev@w3.org
Message-ID: <f5b3cc1vtk4.fsf@erasmus.inf.ed.ac.uk>

"London ." <epsilonknot@hotmail.com> writes:

<snip/>

> [B]ut what i would like to do is have an xsd that could be used to
> validate this:
>
> <data>
>   <value dt="int">1</value>
>   <value dt="string">hello</value>
> </data>


If you control the document, then spell it like this:

<data xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <value xsi:type="xs:int">1</value>
   <value xsi:type="xs:string">hello</value>
</data>

and you'll have what you want.

ht
-- 
  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 Thursday, 4 December 2003 04:08:44 GMT

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