Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370699 - Adjust attribute order of serialized XML root element
Summary: Adjust attribute order of serialized XML root element
Status: CLOSED FIXED
Alias: None
Product: Sphinx
Classification: Automotive
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Christian K. CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-06 05:55 EST by Christian K. CLA
Modified: 2021-07-14 02:16 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian K. CLA 2012-02-06 05:55:51 EST
For XML files serialized using the class ExtendedXMLSaveImpl a certain order of the XML root element attributes is established. The current order of the standard namespace and schema related attributes is:
- xmlns:xsi
- xmlns
- xsi:schemaLocation

This order does not match the order which is produced by common DOM implementations and also JDOM, e.g. Xerces uses an alphabetical order of the attributes [1].

The ordering mismatch produces undesirable side-effects if XML files are processed using other tools/parsers. This might also be done as part of automated testing where test files are processed using DOM/JDOM and text comparison is used for assertations.

The ordering established by ExtendedXMLSaveImpl should be adjusted to be:
- xmlns
- xmlns:xsi
- xsi:schemaLocation

Please note that the wrong order is only produced by ExtendedXMLSaveImpl if it operates in a non-DOM mode (toDOM=false).

[1]: http://xerces.apache.org/xerces2-j/javadocs/xerces2/org/apache/xerces/dom/NamedNodeMapImpl.html
Comment 1 Christian K. CLA 2012-02-23 03:23:37 EST
Class org.eclipse.sphinx.emf.resource.ExtendedXMLSaveImpl was adjusted to desired order of root attributes.
Comment 2 Balazs Grill CLA 2021-07-14 02:16:34 EDT
Mass-closing Resolved tickets