This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: How to add HTML code to variables
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: How to add HTML code to variables
- From: Mike Brown <mbrown at corp dot webb dot net>
- Date: Mon, 7 Feb 2000 12:20:30 -0700
- Cc: "'harald dot normann at wts dot se'" <harald dot normann at wts dot se>
- Reply-To: xsl-list at mulberrytech dot com
> <xsl:template name="TableRow">
> <tr>
> <td><xsl:value-of select="$label"/></td>
> </tr>
> </xsl:template>
xsl:value-of creates a single text node in the result tree. If $label is a
result tree fragment (yours is), then the text node that is created will
contain the concatenation of all the text nodes in the fragment.
When you set $label to be the result tree fragment,
<b>Hello</b>
It is a node structure (not counting namespace nodes):
element 'b'
|___text 'Hello'
It is *not* the character sequence
< b > H e l l o < / b >
You will get the results you want if you simply replace xsl:value-of with
xsl:copy-of.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list