RE: [xsl] Converting entities into string

Subject: RE: [xsl] Converting entities into string
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Thu, 19 Jul 2001 02:48:28 +0100
> In short: how can i convert the '<' and '>' into '&lt;' and
> '&gt;' easily?

You arent trying to convert "<" int "&lt;"; you are trying to convert an
element node called b into a text node whose value is "<b>text</b>". This is
because transformations work on trees: the text node "<b>text</b>" in the
tree will be serialised using "&lt;" in the output file.

So you want something like

<xsl:template match="b">
&lt;b&gt;<xsl:value-of select="."/>&lt;/b&gt;
</xsl:template>

Though why you should want to do something so weird has me quite baffled.

Mike Kay
Software AG


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread