OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Ordering of child nodes after parsing

[ Lists Home | Date Index | Thread Index ]
  • From: Bob Kline <bkline@rksystems.com>
  • To: Gareth Harper <Gareth.Harper@sportal.net>
  • Date: Tue, 19 Dec 2000 08:52:49 -0500 (EST)

On Tue, 19 Dec 2000, Gareth Harper wrote:

> If, for example I have the following piece of xml
> 
> <parent>
> 	<child attribute="blah1"/>
> 	<child attribute="blah2"/>
> 	<child attribute="blah3"/>
> </parent>
> 
> is it written (in the XML spec) anywhere that the parser must return those
> child nodes in the order that they have been given.  I know it sounds right
> that it should, but I need to know if this is in the spec (this is for a
> boolean evaluation system I'm writing in XML / PERL and I need to know if
> for safety's sake I should put some ordering information in my children
> (variables), or if this is built into this spec)
> 

Look at http://www.w3.org/TR/xml-infoset#infoitem.element, which makes
it clear that elements are ordered, attributes unordered.  The DOM spec
(which talks about what parsers must do) defers to this document for
such questions:

    "The Document Object Model does not define what information in a
    document is relevant or how information in a document is structured.
    For XML, this is specified by the W3C XML Information Set [Infoset]."

Presumably other XML parsing models (e.g., SAX) are similarly guided by
the Infoset document.

-- 
Bob Kline
mailto:bkline@rksystems.com
http://www.rksystems.com





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS