Discussions

XML & Web services: xml ordering question

  1. xml ordering question (3 messages)

    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?

    Threaded Messages (3)

  2. xml ordering question[ Go to top ]

    I would say yes. Any other implementation of XSL would sound stupid.
  3. xml ordering question[ Go to top ]

    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. :)

    Chz

    Tony
  4. xml ordering question[ Go to top ]

    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])".

    Gal