[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML 1.0 - Element order significance

  • From: Jonathan Borden <jborden@m...>
  • To: Danny Ayers <danny@p...>, XML Developers List <xml-dev@x...>
  • Date: Mon, 22 Jan 2001 15:44:27 -0500

dom element order
Danny Ayers wrote:

> I read the XML Rec to mean that there's no guarantee of order information
in
> an XML document

Actually in an XML document, sibling elements are *guaranteed* to be
ordered. An XML document is a character stream, and one sibling follows the
other. The question is as to what *processing software* is to do with an XML
document, and you need to look at the particulars of the processing software
to answer that question.

Two types of processors defined by W3C recs are XSLT/XPath and DOM. XPath
clearly preserves element order: e.g given the following document:

<foo>
    <bar id="first" />
    <bar id="second" />
</foo>

and the XPath's:

    /foo/bar[1]/@id = "first"
    /foo/bar[2]/@id = "second"

so the XPath model is ordered.

Likewise the DOM: A NodeList is ordered.

SAX (FWIW :-) is also ordered.

...It may be
> possible for applications to read/write additional information through
> order, but this is beyond the scope of the XML Rec.

The XML REC describes a syntax not a processing model -- but in any case
elements in an XML document are ordered -- whether the order is
*significant* is as Henry notes, dependent on the document's grammar.

>
> Having said that, if the document has an infoset, then information in the
> form of element order may be conveyed through this :
>

Right, so as you note, the Infoset preserves order :-))

Jonathan Borden
http://www.openhealth.org




PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.