<li> <xsl:call-template name="myLinks"> <xsl:with-param name="link" select="$links/link[@Id='link1']" /> <xsl:with-param name="mystr"/> </li>
This is malformed XML -- the element xsl:call-template
isn't closed.
Most probably you wanted:
<li>
<xsl:call-template name="myLinks">
<xsl:with-param name="link" select="$links/link[@Id='link1']" />
<xsl:with-param name="mystr"/>
</xsl:call-template/>
</li>
This invokes the template named "myLinks"
and passes to it two parameters, named: "link"
and "mystr"
.
However, there is no value (in a select
attribute or in the body of the element) defined for the "mystr"
parameter.
If you want to provide a value for the parameter -- for example the result of executing a function, this can be done as follows:
<li>
<xsl:call-template name="myLinks">
<xsl:with-param name="link" select="$links/link[@Id='link1']" />
<xsl:with-param name="mystr" select="myStrfunc()"/>
</xsl:call-template/>
</li>
Then in the body of the called template, the value of the parameter can be accessed simply by referencing it:
<link Id="link1">
<a href="" text="click" />
<xsl:value-of select="$mystr"/>
</link>
Or, if you need to use $mystr
to generate the value of the href
attribute, then do:
<link Id="link1">
<a href="{$mystr}" text="click" />
</link>