| Subject: How to add HTML code to variables From: "Harald Normann" <harald.normann@xxxxxx> Date: Sun, 6 Feb 2000 12:26:49 +0100 | 
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
| Current Thread | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| Re: How to add HTML code to variabl, mohamed | Thread | Re: How to add HTML code to variabl, Steve Tinney | 
| no way to avoid errors if getting b, Mark D. Anderson | Date | Re: How to add HTML code to variabl, Steve Tinney | 
| Month |