Subject: RE: [xsl] combining two variables to generate XPATH From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 17 Dec 2002 15:27:37 -0500 |
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?
Cheers, Wendell
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
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] combining two variables t, bix xslt | Thread | RE: [xsl] combining two variables t, Robert Koberg |
Re: [xsl] Updating XML, Marko Petersen | Date | Re: [xsl] output method html doesnt, Niko Matsakis |
Month |