In an existing XSL stylesheet I was passing a string into a named template. Due to a requirements change, I now need to display four strings, the string I was displaying and its three siblings. Rather than pass the four separate strings into the named template, I'm trying to pass their parent element (PETrailingFund in the code below),
<xsl:call-template name="row">
<xsl:with-param name="label">Price/Earnings Trailing</xsl:with-param>
<xsl:with-param name="formatMarker">x</xsl:with-param>
<xsl:with-param name="fund" select="PETrailingFund" />
<xsl:with-param name="benchmark">
<xsl:value-of select="benchmark/PETrailingBenchmark"/>
</xsl:with-param>
<xsl:with-param name="benchmark2">
<xsl:value-of select="benchmark2/PETrailingBenchmark"/>
</xsl:with-param>
</xsl:call-template>
but the transformation blows up when I try to work with the "fund" parameter in the named template:
<xsl:template name="row">
<xsl:param name="label" />
<xsl:param name="fund" />
<xsl:param name="benchmark">NOT PROVIDED</xsl:param>
<xsl:param name="benchmark2">NOT PROVIDED</xsl:param>
<xsl:param name="formatMarker"> </xsl:param>
<xsl:param name="useDecimalFormatter">yes</xsl:param>
<tr>
<td class="first popup">
<xsl:value-of select="$label" disable-output-escaping="yes"/>
</td>
<td>
<xsl:if test="$benchmark = 'NOT PROVIDED'">
<xsl:attribute name="class">last</xsl:attribute>
</xsl:if>
<xsl:value-of select="$fund/child::*" />
<xsl:value-of select="$formatMarker"/>
</td>
</tr>
</xsl:template>
From what I've read, I'm not really passing in a node but a result tree fragment and I need to get it back to a node (or node-set). Is that accurate or am I doing something else wrong? How would I convert it (I'm working in a fairly stock PHP5 environment that I can't change).
N.B., I trimmed a good bit of the named template for simplicity's sake.