This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes org.w3c.dom.* saves my XML with attributes in alphabetical order Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "org.w3c.dom.* saves my XML with attributes in alphabetical order" Watch "org.w3c.dom.* saves my XML with attributes in alphabetical order" New topic
Author

org.w3c.dom.* saves my XML with attributes in alphabetical order

Guy Harel
Greenhorn

Joined: Oct 21, 2009
Posts: 8
I have read many posts saying that there was no solution to the problem of attribute alphabetical name ordering during a document save. I am wondering if there is now a solution ? The new XML crashes a .NET application...


Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Then that .NET application is badly written. The XML specification allows attributes to appear in any order. Any XML parser / reader should be able to handle this.

Anyway, moving to our XML forum.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Guy Harel
Greenhorn

Joined: Oct 21, 2009
Posts: 8
I will try to use JDom instead, perhaps it won't change the attribute order.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Good luck with that. I can't believe that .NET comes with broken XML parsers, I'm sure it must be the C# application which is doing something wrong. I agree with Rob Prime that fixing that would be the appropriate thing to do.
Guy Harel
Greenhorn

Joined: Oct 21, 2009
Posts: 8
Well its a C++.NET DLL which uses the framework-loaded XML file "MyApp.exe.config", but indeed the bug comes from retreiving attributes in the non framework section of the XML. So not a bug in .NET. Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.w3c.dom.* saves my XML with attributes in alphabetical order
 
Similar Threads
XML doument to a string
Getting length(no of bytes) of Dom document which is in memory
Problem Overwriting XML Section
File Output stream adding extra character while writing
Overwriting a specific XML section