• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Attributes in Alphabetical Order

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey All,

I am storing xml in SQL Server, and then putting it into a document to send across the interweb. One thing I noticed upon recieving this XML document is that the attributes are in alphabetical order. For the most part I understand that this is irrelavent. I would like to know however what is causing this. Is it SQL or org.w3c.dom. I see a lot of people online pointing at org.w3c.dom, but was wondering if thats a standerd feature or if it means somthing was done incorrectly? does org.w3c.dom always alphabitise XML attributes? Is it possible SQL did it? I need to be able to explain why its happinig even if I dont need to change it so that it dosent happen.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Lark wrote:I need to be able to explain why its happinig.



No, you don't. The XML Recommendation (as it appears you already know) says the order of attributes is meaningless. Given that, there is no need to explain why any particular serializer outputs attributes in the order it outputs them. It suffices to say that they do what they do.

 
John Lark
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the quick response, so then I can say confidently this is simply what the org.w3c.dom does?
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Lark wrote:Thanks for the quick response, so then I can say confidently this is simply what the org.w3c.dom does?



Not really, no. Those classes store XML in a tree structure but as far as I know they don't serialize XML to a document. Look more closely at your code to see what's actually doing the serialization.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic