Why doesn't XML have Set?

Paul Prescod paul at prescod.net
Fri Mar 26 18:05:09 GMT 1999

"Roger L. Costello" wrote:
> Then let me ask another question - why do DTDs not allow me to specify
> an unordered list of elements?  For example,
> <!ELEMENT Kitchen RDF:Bag(Sink, Stove, Refrigerator)>
> With this notation I am trying to indicate that an XML document that
> conforms to this DTD must have a <Kitchen> element which has three child
> elements - <Sink>, <Stove>, and <Refrigerator>, and these child elements
> can be in any order.  Isn't this a useful thing?  

Is it useful? The author or text generator has been given no new
flexibility about *what* to write, only the order. What would they
indicate through the order, that the sink is "more important" than the
stove? That's a stretch. Allowing things in any order may be a convenience
for the generator but it will very seldom allow anything interesting to be
expressed. And it is an inconvenience for the consumer because now the
processing app has to walk around the tree to find out where the Stove is
rather than just going to the second child element.

> I have had a number of times where I wish that I could do this.

That wish usually goes away after a while. You start to wonder if there is
really any benefit in complicating your document type and creating more
work for yourself without making the language more expressive.

 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself

"Perpetually obsolescing and thus losing all data and programs every 10
years (the current pattern) is no way to run an information economy or
a civilization." - Stewart Brand, founder of the Whole Earth Catalog

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)

More information about the Xml-dev mailing list