XSL html entities

"Atul Shinh" <[email protected]> Thu, 11 Dec 2008 11:38:59 +0530
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
Hi all,

I am facing an problem with HTML entities in XSL processing. My XML file
contains HTML entities like "&gt;", "&lt;"  (without quotes). So when I try
to produce an PDF from this XML using an XSL file these entities are getting
output as such, not being rendered as (< , >).

So I tried using string-replace enhanced template
===================================================
 <xsl:template name="SEARCH-AND-REPLACE">
    <xsl:param name="string" />
    <xsl:param name="search-for" />
    <xsl:param name="replace-with" />
    <xsl:choose>
       <xsl:when test='contains($string,$search-for)'>
          <xsl:call-template name="SEARCH-AND-REPLACE">
             <xsl:with-param
                name="string"
                select='concat( substring-before($string,$search-for),
 $replace-with, substring-after($string,$search-for) )' />
            <xsl:with-param name="search-for" select="$search-for" />
             <xsl:with-param name="replace-with"
 select="$replace-with" />
          </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
          <xsl:value-of select="$string" />
       </xsl:otherwise>
    </xsl:choose>
 </xsl:template>
======================================================

Is this approach right ?
If yes then how can I pass $string, $search.


Regards

_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list