XSLT - Catching parameters
Posted
by Brian Roisentul
on Stack Overflow
See other posts from Stack Overflow
or by Brian Roisentul
Published on 2010-05-13T19:46:57Z
Indexed on
2010/05/13
20:54 UTC
Read the original article
Hit count: 304
The situation is I have two xslt files: one is called from my ASP.NET code, and there, the second xslt file is imported.
What I'd like to accomplish is to pass a parameter to the first one so the second xslt(the one that is imported at the first xslt) can read it.
My c# code looks like this:
var oArgs = new XsltArgumentList();
oArgs.AddParam("fbLikeFeatureName", "", "Facebook_Like_Button");
ltlContentBody.Text = xmlUtil.TransformXML(oXmlDoc, Server.MapPath(eSpaceId + "/styles/ExploringXSLT/ExploreContentObjects.xslt"), true);
And I'm catching the param at the first xslt this way:
<xsl:param name="fbLikeFeatureName" />
And then, passing it to the second xslt like this(previously, I import that file):
<xsl:call-template name="Articles">
<xsl:with-param name="fbLikeFeatureName"></xsl:with-param>
</xsl:call-template>
Finally, I'm catching the param on the second xslt file as following:
<xsl:value-of select="$fbLikeButtonName"/>
What Am I doing wrong? I'm kind of new at xslt.
© Stack Overflow or respective owner