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

XSLT2 xsl:sequence blocking ancestor refs?

Subject: XSLT2 xsl:sequence blocking ancestor refs?
From: Marshall Schor <msa@xxxxxxxxx>
Date: Tue, 27 Mar 2007 08:31:43 -0400
 XSLT2 xsl:sequence blocking ancestor refs?
Using xsl:sequence seems to chop off the ability to reference ancestors
of selected nodes.
Is this working-as-designed?

Here's a quick demo.  In this piece of test code, the variable "b" has
no parent, while the variable "a" does:

<xsl:variable name="in">
   <e1>
     <e2>
       <e3>
         <e4>yes</e4>
       </e3>
     </e2>
   </e1>
 </xsl:variable>

<xsl:template match="anything_to_get_started">

   <xsl:variable name="p" select="$in/e1/e2/e3/e4"/>
   <xsl:variable name="a" select="$p"/>
   <xsl:message select="'parent of a'"/>
   <xsl:message select="$a/parent::node()"/>

   <xsl:variable name="b">
     <xsl:sequence select="$p"/>
   </xsl:variable>
   <xsl:message select="'parent of b'"/>
   <xsl:message select="$b/parent::node()"/>

</xsl:template>

The output using Saxon 8.9

    [java] parent of a
    [java] <e3><e4>yes</e4></e3>
    [java] parent of b


-Marshall Schor


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.