XML & Web services: xml ordering question
If a set of XML elements are in a particular order, and you have XSL looping through them, is XSL guarranteed to output these elements in the same order in which they appear in the XML file?
I would say yes. Any other implementation of XSL would sound stupid.
Yes it will. XML represents data. Order in data is implicitly important. The data items will come out the other side in the order they occur in the XML. XSLT processing would be useless without this fact. :)
Some reasonable heuristic arguments have been made to answer the question, but just for completement here is a normative reference: http://www.w3.org/TR/xslt#for-each:
"... The nodes are processed in document order, unless a sorting specification is present (see [10 Sorting])".