xsl-list
[Top] [All Lists]

Re: Using a template's (HTML) output as with-param?

2005-12-09 01:31:19
URL template:

      <xsl:template name="HrefTest">
              <xsl:text><h3>test</h3></xsl:text>
      </xsl:template>

Caption template:
      <xsl:template name="TableHeader">
              <xsl:param name="caption1" />
              <xsl:param name="caption2" />
              <tr><td><h1><xsl:value-of select="$caption1"
/></h1></td></tr>
              <tr><td><xsl:value-of select="$caption2" /></td></tr>
      </xsl:template>

Usage:
      <table>
              <xsl:call-template name="TableHeader">
                      <xsl:with-param name="caption1">First
Caption</xsl:with-param>
                      <xsl:with-param name="caption2">
                              <xsl:call-template name="HrefTest" />
                      </xsl:with-param>
              </xsl:call-template>
      </table>

Expected result:
<table><tr><td><h1>First
Caption</h1></td></tr><tr><td><h3>test</h3></td></tr></table>

Actual result:
<table><tr><td><h1>First
Caption</h1></td></tr><tr><td>test</td></tr></table>



Change

<xsl:value-of select="$caption2"/>

to

<xsl:copy-of select="$caption2"/>

and it should be fine.


HTH,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>