This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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