File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 19692
    
  20

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: 18563
    
    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