W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2004

Re: Freely nested elements in Schema

From: Wyatt Barton <hiddenharvest@yahoo.com>
Date: Wed, 28 Jan 2004 13:24:56 -0800 (PST)
Message-ID: <20040128212456.82739.qmail@web40607.mail.yahoo.com>
To: xmlschema-dev@w3.org

Hi,
Do any of you know an elegant way in XML Schema to
declare elements or types, such that empty or paired
tags may appear "freely" in an instance doc? What I
want to do is similar to HTML except, of course, that
tags cannot overlap (viz, "<A> <B> </A> </B>").

To clarify, let's say that the containing element
is delimited by the tags <BODY></BODY>, its type is
"mixed", and an instance doc is free to nest
inside it the tags <B></B>, <FONT></FONT>, and
<IMG/> in any order. Then, in an instance doc one
might write:

"<BODY>The <FONT><B>quick</B> brown fox<IMG/></FONT>
jumped</IMG> over the lazy
<B><FONT>dog</FONT>.</B></BODY>"

I expect the solution likely is in using a recursive
Type definition, possibly simplified by using a
substitution group.

Your advice and an example or reference would be
much appreciated!
Thanks,
- Louis

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
Received on Wednesday, 28 January 2004 21:39:58 GMT

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