This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:with-param
Hi Corneanu,
> Can you give me some help on calling a template with a tree-fragment
> as a parameter?
You're doing the calling just right - it's the *using* where you're
running into difficulties. In your template, you get the *value* of
the $firstCell and $secondCell parameters:
> <xsl:template name="addRow">
> <xsl:param name="firstCell"/>
> <xsl:param name="secondCell"/>
> <fo:table-row font-size="12pt" line-height="14pt">
> <fo:table-cell>
> <fo:block><xsl:value-of select="$firstCell"/></fo:block>
> </fo:table-cell>
> <fo:table-cell>
> <fo:block><xsl:value-of select="$secondCell"/></fo:block>
> </fo:table-cell>
> <fo:table-row>
> </xsl:template>
What you need to do is *copy* the values of those parameters with the
xsl:copy-of instruction:
<xsl:template name="addRow">
<xsl:param name="firstCell"/>
<xsl:param name="secondCell"/>
<fo:table-row font-size="12pt" line-height="14pt">
<fo:table-cell>
<fo:block><xsl:copy-of select="$firstCell"/></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block><xsl:copy-of select="$secondCell"/></fo:block>
</fo:table-cell>
<fo:table-row>
</xsl:template>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list