Re: [ILUG] [OT] XML element ordering

From: Philip Reynolds (phil at domain redbrick.dcu.ie)
Date: Tue 10 Sep 2002 - 13:22:53 IST


Padraig Brady's [padraig.brady at domain corvil.com] 33 lines of wisdom included:
> Padraig Brady wrote:
> > Justin MacCarthy wrote:
> >
> >> Elements followed by commas are expected to be in the order the
> >> appear in
> >> the DTD.
> >>
> >> <!ELEMENT name (attr_one*, attr_two, attr_three?, attr_four )>
> >>
> >> expects the elements in order but
> >>
> >> <!ELEMENT name (attr_one* attr_two attr_three? attr_four )>
> >>
> >> doesn't.
>
> Are you sure about this?
> I looked in XML in a Nutshell and there was no mention
> of this syntax. Also comp.text.xml suggested
> if you wanted unordered stuff then you must
> use attributes rather than elements?

Well, with the example you supplied, I can tell you this, you
defined a DTD, with a comma-delimited list of child element names,
which is also known as a sequence list.

They must _always_ appear in the sequence shown in the declaration.

So to answer your original post, no, that was wrong.

As regards, Justins answer, I can't confirm this, but I've certainly
never read any XML documentation to confirm what he's saying.

-- 
  Philip Reynolds        
   RFC Networks          tel: 01 8832063
www.rfc-networks.ie      fax: 01 8832041


This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:18:45 GMT