[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: in-document references
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|