Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] attribute ordering

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Steve Loughran <steve.loughran AT gmail.com>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] attribute ordering
  • Date: Mon, 22 Jan 2007 07:26:41 -0500

Steve Loughran wrote:
simple question: when I enum attributes of a Xom element, does it come
in any fixed order? And if so, is the order formalised and stable, or
some implementation detail that may change over time?



Attribute order is not defined, stable, or reliable. It is also not part of the XML infoset. Attribute order in XOM is probably related to the attribute order reported by the underlying SAX parser, but I don't promise that; and the SAX order is itself not defined, stable, or reliable.

Once you've parsed an element, XOM will not change the order of its attributes. Attribute 3 of element X is still attribute 3 of element X 5 minutes later. However, if you reparse the same document a second time that attribute may now become attribute 2 or 4.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/




Archive powered by MHonArc 2.6.24.

Top of Page