DOM parsers always return elements in the same order as in the XML document
they are parsing. However, the ordering of attributes on an element is not
guaranteed to be the same.
<a x="2 "y="1" >bla</a>
<c>bla bla bla</c>
if you get the collection of nodes below the root element doc, the
collection is returned in the order a, b, c.
But if you get the collection of attributes on element a, they could get
returned in any order.
From: susan Ge [mailto:[log in to unmask]]
Sent: 01 December 2000 16:23
To: [log in to unmask]
Subject: order of the repeating elements
I am a simple question, if any one can help out.
If I define the Customer as repeat element in DTD as the following:
<!ELEMENT CommonData ( Customer+ , Address )>
<!ELEMENT Customer ( CustomerID , Name , Relation? )>
<!ELEMENT CustomerID (#PCDATA )>
<!ELEMENT Name (#PCDATA )>
<!ELEMENT Relation (#PCDATA )>
The XML document will put all Customers in a nature order as I want to see,
if I use any DOM parser, does it guarantee comes up the same order as on the
document or a sequence no is needed to insure the order?
Susan ([log in to unmask])