RE: [ILUG] [OT] XML element ordering

From: Justin MacCarthy (macarthy at domain iol.ie)
Date: Mon 09 Sep 2002 - 17:38:54 IST


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.

In XML Schema the equiv. is <sequence>

Justin

> -----Original Message-----
> From: ilug-admin at domain linux.ie [mailto:ilug-admin at domain linux.ie]On Behalf Of
> Padraig Brady
> Sent: 09 September 2002 17:20
> To: ilug at domain linux.ie
> Subject: [ILUG] [OT] XML element ordering
>
>
> I sent the following to comp.text.xml with no response, so...
>
> If in a dtd you have the following
> declaration of an element:
>
> <!ELEMENT name (
> attr_one*,
> attr_two,
> attr_three?,
> attr_four
> )
> >
>
> Is there any order implied for attr_one etc?
> I think that you can't assume any order.
> In other words are both of the following
> valid XML?
>
> <name>
> <attr_two/>
> <attr_four/>
> </name>
>
> <name>
> <attr_four/>
> <attr_two/>
> </name>
>
> thanks,
> Padraig.
>
>
> --
> Irish Linux Users' Group: ilug at domain linux.ie
> http://www.linux.ie/mailman/listinfo/ilug for (un)subscription
> information.
> List maintainer: listmaster at domain linux.ie
>
>
>



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