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

RE: in-document references

Subject: RE: in-document references
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 8 Jan 2003 11:10:42 -0000
xsl define node set
> What I want to do is to locate the appropriate "define" node-set, and 
> have XSLT pretend that the "define" nodeset is in the place of the 
> "ref" node. Right now I am using <xsl:apply-templates> to apply the 
> templates to the "define" nodeset. But that's not good 
> enough, because 
> I'd like to be able to treat the anscestors of the "ref" node as the 
> ancestors of the "define" nodeset. That would make my 
> programming a lot 
> easier.
> 
> How do I do that?

You're making things much more difficult than they are. Perhaps you have
overlooked that a path expression can start with a variable reference:

<xsl:apply-templates select="define">
  <xsl:with-param name="ref" select="ref"/>
</xsl:apply-templates>

<xsl:template match="define">
  <xsl:param name="ref"/>
  <xsl:value-of select="$ref/ancestor::foo/@bar"/>
</xsl:template>

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.