Hi Ralph,

Your assumption is correct - the child nodes in the DOMNodeList will be in document order.

John

Ralph van Etten wrote:
Hi,

I have a question about the ordering of elements in the XercesDOMParser.

In what order are the elements retrieved with DOMNode::getChildNodes() ?
Are they in the same order as they appeared in the XML document or can they also appear in some different order?

So, if I have the following XML

<rule id="first">...</rule>
<rule id="middle">...</rule>
<rule id="last">...</rule>

will the first element in the DOMNodeList returned by getChildNodes() contain the rule with id first etc ?
I like to know for sure because I could not find any documentation on it.

Thanks,

Ralph.


--
John Snelson, Oracle Corporation            http://snelson.org.uk/john
Berkeley DB XML:            http://oracle.com/database/berkeley-db/xml
XQilla:                                  http://xqilla.sourceforge.net

Reply via email to