I ran into an annoying thing last night where I couldn't do what I was trying to do. Wondering if anybody knew of a better way?

Basically I needed to make a with-param "smarter", so it had a choose statement. But I wasn't passing a string with my with-param, I was passing the node itself.

This works:

<xsl:call-template name="sum-hours">
    <xsl:with-param name="item" select="$item/following-sibling::entry[1]"/>

But this doesn't:

<xsl:call-template name="sum-hours">
    <xsl:when test="$type = 'section'">
        <xsl:value-of select="$item/following-sibling::entry[estimate-section-link/item/@id = $selectorid][1]"/>
    <xsl:when test="$type = 'task'">
        <xsl:value-of select="$item/following-sibling::entry[estimate-task-link/item/@id = $selectorid][1]"/>

Obviously value-of is to blame here, because it's creating a string, but I can't think of another way to do it?

Please help!!

Your second block does not have a xsl:with-param in it. How is it passing the parameter?

Instead of putting choose inside call-templates, how about putting separate call-template calls inside the when blocks?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details