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: "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 14:48:05 +0000

On 22/01/07, Elliotte Harold <elharo AT metalab.unc.edu> wrote:
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.

Thank you!

-steve




Archive powered by MHonArc 2.6.24.

Top of Page