Note that there are some explanatory texts on larger screens.

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

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload