This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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