This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: How to add HTML code to variables


>   <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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]