[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl:with-param

Subject: Re: xsl:with-param
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 15 Mar 2002 18:42:56 +0000
xsl with param fo table
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.