The following comment has been added to this issue:
Author: Joe Kesselman
Created: Thu, 9 Sep 2004 6:28 AM
Body:
The default order is "whatever order is most efficient for the processor" -- which I
believe is hashcode order for the most part, with some possible exceptions for
namespace declarations and possibly for attributes added late in the process by
explicitly copying or creating attributes.
It is stable in the short term, in that the same data and stylesheet run through a
single release of Xalan on a single JVM will produce attributes in the same order. But
there is no intent that we guarantee order of attributes.
XML officially considers attribute order meaningless. If you're using a tool which
cares about it, it isn't processing XML correctly.
The main objection to this tends to be that folks want to use a text-based "diff" on
XML files... and you really can't; you need an XML-aware file comparison tool (as
others have noted, that's what we use in our test suite). That isn't a Xalan issue;
it's basic to XML.
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/XALANJ-1940?page=comments#action_52994
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/XALANJ-1940
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XALANJ-1940
Summary: Default order of output/serialized attribute inconsistent.
Type: Improvement
Status: Resolved
Priority: Major
Resolution: WON'T FIX
Project: XalanJ2
Assignee:
Reporter: Ed Knoll
Created: Wed, 8 Sep 2004 2:02 PM
Updated: Thu, 9 Sep 2004 6:28 AM
Environment: Sun/Solaris 2.8; JDK 1.4; Xalan-J 2.6
Description:
We are creating an XML file from another XML file. During this process we will add
attriubtes to some of the input elements. If we execute this transformation using
org.apache.xalan.xslt.Process directly, our (generated) attributes come out in one
order. If we execute this process with a Java program which uses Transformer, DOM and
Serializer classes directly, we get a different attribute order.
This has no effect on downstream processing. However, from a regression testing
perspective where we are comparing new test results to old this does become a (minor)
issue.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]