> Call me naive or maybe just a newb but I didn't know that the order in which > attributes appear on an element in bxml mattered. I mean, in XML > > <element attr1="d24" attr2="hahth"/> > > and > > <element attr2="hahth" attr1="d24"/> > > are the same when considering each document's infoset.
That may be true, but in the DOM order has relevance. Attributes are stored as a list, not a map. Pivot's org.apache.pivot.xml.Element class provides both keyed and indexed access to attributes. > Yet there are clearly cases where the order in which the attributes are > written is key. The one I ran into a moment ago is pretty simple. The > following works > > <ListView listData="['One', 'Two', 'Three']" selectedIndex="0"/> > > while the following does not > > <ListView selectedIndex="0" listData="['One', 'Two', 'Three']"/> > > The latter throws an IndexOutOfBoundsException. Thoughts? The first one works because the list data is set before the selected index. The second one fails because the list is empty when the selected index is set. If ordering did not matter, we'd have no way to know which attribute to set first.
