File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes XML: Order of elements, do they matter? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML: Order of elements, do they matter?" Watch "XML: Order of elements, do they matter?" New topic

XML: Order of elements, do they matter?

Rajagopal Manohar
Ranch Hand

Joined: Nov 26, 2004
Posts: 183
Fragment 1

Fragment 2

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

Dave Lenton
Ranch Hand

Joined: Jan 20, 2005
Posts: 1241
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.

There will be glitches in my transition from being a saloon bar sage to a world statesman. - Tony Banks
I agree. Here's the link:
subject: XML: Order of elements, do they matter?
It's not a secret anymore!