>> An element's child nodes are also accessible via Node#getChildNodes(), which >> returns an ordered list of children. > > True, but attributes are not children of elements and are not returned in a > call to getChildNodes().
That is interesting. It has been a while since I worked with DOM - since Attr extends Node, I assumed they would be. Thanks for the clarification. > Attributes in StAX have a specific ordering applied, but the spec says > nothing about what order that is. An implementation could order the > attributes in reverse to their appearance in the XML file and still be in > full compliance. An implementation need only provide some enumaration for > indexed access. You are correct. I had assumed that, since StAX is a streaming API, attributes would be processed and accessed in the order in which they are encountered. This appears to be the case in practice (both with the BEA implementation as well as the JDK's), but the spec does not guarantee it. > I'm really not suggesting that attribute ordering is irrelevant to > BXMLSerializer. I'm just saying that XML doesn't provide attribute ordering. > It's just one of those limitations of XML as a serialization language. I don't think it is necessarily an inherent limitation of the language - for example, org.apache.pivot.xml.Element preserves attribute order. But for whatever reason, the designers of StAX and DOM chose not to. Oh well.
