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

Re: [Moderator Action] Elements outside of a sequence tag

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 05 Dec 2000 21:01:35 +0000
To: "Chris Mosbrucker" <chris@proworks.com>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5b3dg2bn0w.fsf@cogsci.ed.ac.uk>
"Chris Mosbrucker" <chris@proworks.com> writes:

> Hello,
> 
> I am trying to write an xml schema, and am having some problem figuring out
> how to have elements present outside of <sequence> blocks. Every example I
> can find on w3 seems to contain the <element /> in <sequence> tags like the
> following.
> 
> <sequence>
>  <element name="anyElement" />
>  <element name="someElement" />
> </sequence>
> 
> But that implies that <anyElement> will always appear before <someElement>
> 
> what if anyElement and someElement can appear in any order and number. i.e.
> 
> <someElement />
> <anyElement />
> <anyElement />
> <someElement />

See the XML Schema Primer [1].  You want <choice> instead of
<sequence>

ht

[1] http://www.w3.org/TR/xmlschema-0/
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-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/
Received on Tuesday, 5 December 2000 16:01:42 GMT

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