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

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

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!
- Louis

Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
Received on Wednesday, 28 January 2004 21:39:58 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:04 UTC