Hi
I've just changed our application to switch to Xerces 2 and noticed
the order of attributes, while irrelevant according to the XML spec, is
changed to alphabetical when Xerces loads up a DOM.
While I think it is fine for Xerces to sort attributes alphabetically, for
fast attribute access times, it does have one or two side
effects. For example, if you load up an XML document in DOM and
simply write it back out, a "diff" of the input and output files will
show the file to have changed because the attributes have
been re-ordered.
As a result, I have modified the org.apache.xerces.dom.NamedNodeMapImpl
class (attached) to allow for a new "feature" to maintain the order of occurrence of
attributes as they are set on each element. This is only a minor code
change and probably only slightly impacts performance.
Would the apache Xerces team be interested in this fix and add it in
to the source code base?
Thanks in advance,
Gary Watson
________________________________________
IT Consultant
Department of Trade and Industry
Energy Resource Development Unit (ERDU)
tel: +44 (0) 20 7215 5157 <<NamedNodeMapImpl.java>>
The original of this email was scanned for viruses by the Government Secure Intranet (GSi) virus scanning service supplied exclusively by Energis in partnership with MessageLabs.
On leaving the GSi this email was certified virus-free
NamedNodeMapImpl.java
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
