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: Converting entities into string


> 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


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