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

RE: combining two variables to generate XPATH

Subject: RE: combining two variables to generate XPATH
From: "bix xslt" <bix_xslt@xxxxxxxxxxx>
Date: Tue, 17 Dec 2002 20:08:20 +0000
xslt generate xpath
Is that FAQ outdated?? I know that the following code works just fine:

<xsl:template match="proc">
 <xsl:call-template name="foo">
   <xsl:with-param name="node" select="." />
 </xsl:call-template>
</xsl:template>

<xsl:template name="foo">
 <xsl:param name="node"/>
 <xsl:for-each select="$node/branch/leaf">
   <xsl:value-of select="@id" />
 </xsl:for-each>
</xsl:template>

What is different about a path with a single variable, and a path with two variables? Why can't I specify a second variable:

<xsl:template name="foo">
 <xsl:param name="node"/>
 <xsl:param name="branch" select="'someBranch'"/>
 <xsl:for-each select="$node/$branch/leaf">
   <xsl:value-of select="@id" />
 </xsl:for-each>
</xsl:template>



From: Mark Wilgus <mwilgus@xxxxxxxxx>

I believe this is not possible.  XSLT doesn't allow you
to use a variable for an XPath expression.  See number 2 at
the following list:

http://www.dpawson.co.uk/xsl/sect2/nono.html

> -----Original Message-----
> From: bix xslt [mailto:bix_xslt@xxxxxxxxxxx]

> >        <xsl:variable name="branch"
> >select="concat($node,'/',$type,'/item')" />
> >        <xsl:value-of select="$branch" />
> ><!--        <xsl:for-each select="$branch">
>



_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



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.