Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML: Order of elements, do they matter?

 
Rajagopal Manohar
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fragment 1

Fragment 2


Are Fragment 1 & 2 equvivalent xml documents going by XML specifications.

Thanks,
Rajagopal
 
Dave Lenton
Ranch Hand
Posts: 1241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In theory (according to the specs IIRC) it doesn't matter about the order..... but.... quite often the things done with XML such as SAX parsing, XSL, transforming data into displayed content and so on do give different results depending upon the order of the nodes. Also if it has a DTD associated with it then the order may matter. So, its depends much on what you're going to do with the XML as to if you should be worried about the order or not.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic