Aug 18, 2007

xslt parameter

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
<xsl:param name="Age" ></xsl:param>
<xsl:template match="/">
<xsl:value-of  select="$Age"/>
XmlTextWriter xmlwriter = new XmlTextWriter(writer);
XsltArgumentList list = new XsltArgumentList();
list.AddParam("Age", "", "108");
xslt.Transform(doc, list, xmlwriter);

Parameter of a template

<xsl:apply-templates select="$castList" mode="DisplayToggle">
            <xsl:with-param name="divID" select="$programID" />

            <xsl:template match="CastList" 

Basically parameter can be used variable, and constructed as variable. The difference is used with template. The "xsl:with-param" element is optional, if it is not defined, the default value of "xsl:param" will be used.

<xsl:apply-templates select="$orderRow">
<xsl:with-param name="sn1" select="1" />
<xsl:template match="Row">
<xsl:param name="sn" select="2"></xsl:param>
<xsl:param name="sn1" select="$sn"></xsl:param>