[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Document reordering after applying path expression

Subject: Document reordering after applying path expression
From: "Max Toro maxtoroq@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Jun 2015 19:19:58 -0000
 Document reordering after applying path expression
The following stylesheet:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" exclude-result-prefixes="#all"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:xs="http://www.w3.org/2001/XMLSchema">

   <xsl:output method="xml" indent="yes"/>

   <xsl:template name="main">

      <xsl:variable name="a">
         <a/>
      </xsl:variable>

      <xsl:variable name="b">
         <b/>
      </xsl:variable>

      <for-each1>
         <xsl:for-each select="reverse(($a, $b))">
            <xsl:copy-of select="."/>
         </xsl:for-each>
      </for-each1>

      <for-each2>
         <xsl:for-each select="reverse(($a, $b))/*">
            <xsl:copy-of select="."/>
         </xsl:for-each>
      </for-each2>

   </xsl:template>

</xsl:stylesheet>

Outputs:

<?xml version="1.0" encoding="UTF-8"?>
<for-each1>
   <b/>
   <a/>
</for-each1>
<for-each2>
   <a/>
   <b/>
</for-each2>

Why is the sequence reordered after applying a path expression?
Is this conformant with the standard? If yes, what section talks about it?

I'm using Saxon 9.6.0.6.

Original post: http://stackoverflow.com/questions/31126950

--
Max Toro

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.