|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to add HTML code to variables
Hi,
I'm not succeding in passing HTML to a template. I'm trying to create a
template for creating rows in a table. The template is called using a
parameter named "label". The template looks like:
<xsl:template name="TableRow">
<tr>
<td><xsl:value-of select="$label"/></td>
</tr>
</xsl:template>
When calling the template I use the following syntax:
<xsl:template match="FreeText">
<xsl:call-template name="TableRow">
<xsl:with-param name="label">Hello</xsl:with-param>
</xsl:call-template>
</xsl:template>
This workes fine, however I'm not succeding in adding HTML code to the
variable.
<xsl:template match="FreeText">
<xsl:call-template name="TableRow">
<xsl:with-param name="label"><b>Hello</b></xsl:with-param>
</xsl:call-template>
</xsl:template>
The result is "Hello" without bold! Where do the <b></b> directives goes? I
have also tryed to declare a separate variable:
<xsl:template match="FreeText">
<xsl:variable name="somevalue">
<b>Hello</b>
</xsl:variable>
<xsl:call-template name="TableRow">
<xsl:with-param name="label"><xsl:value-of
select="$somevalue"/></xsl:with-param>
</xsl:call-template>
</xsl:template>
This also just produce "Hello" without bold. Using XML charachter code:
<xsl:template match="FreeText">
<xsl:variable name="somevalue">
<b>Hello</b>
</xsl:variable>
<xsl:call-template name="TableRow">
<xsl:with-param name="label"><xsl:value-of
select="$somevalue"/></xsl:with-param>
</xsl:call-template>
</xsl:template>
Now the screen displays "<b>Hello</b>". The <b></b> is not interpreted as
HTML code. How is this really solved?
TIA
/Harald
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








