Dear all,
I have an xml file as
<Word_of_day>
<Document_id>
1
<title> sample title </title>
<source> Sample source </source>
<description> sample description approximately 3 paragraphs of data </description>
</Document_id>
....
..
.
....
</Word_of_day>
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
------
I have written the xsl file that searchs & replaces the text ie
it searches for "brk" word within the <Description> tag & replaces with "<br/>" tag.
But when i try to transform the xml file to html thru the below mentioned xsl file,
it will not replace "brk" with "<br/>"...
can anybody help........
the xsl file is as follows :
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template name="globalReplace">
<xsl:param name="outputString"/>
<xsl:param name="target"/>
<xsl:param name="replacement"/>
<xsl:choose>
<xsl:when test="contains($outputStri
ng,$target
)">
<xsl:value-of select=
"concat(substring-before($
outputStri
ng,$target
),
$replacement)"/>
<xsl:call-template name="globalReplace">
<xsl:with-param name="outputString"
select="substring-after($o
utputStrin
g,$target)
"/>
<xsl:with-param name="target" select="$target"/>
<xsl:with-param name="replacement"
select="$replacement"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$outputString"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="text()">
<xsl:call-template name="globalReplace">
<xsl:with-param name="outputString" select="."/>
<xsl:with-param name="target" select="'brk'"/>
<xsl:with-param name="replacement" select="'<br/>'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="Word-of-day/Documen
t_id/Descr
iption/tex
t()">
<xsl:call-template name="globalReplace">
<xsl:with-param name="outputString" select="."/>
<xsl:with-param name="target" select="'brk'"/>
<xsl:with-param name="replacement" select="'<br/>'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="/">
<html>
<body>
<table border="1">
<tr bgcolor="#9acd32">
<!--<xsl:for-each select="Word_of_day/Docume
nt_id[posi
tion()>las
t()-5]">--
>
<xsl:for-each select="Word_of_day/Docume
nt_id">
<xsl:sort select="Document_id" order="descending"/>
<tr>
<td>
<a target='new'><xsl:attribut
e name='href'>description.ht
m#<xsl:val
ue-of select="text()"/></xsl:att
ribute><xs
l:value-of
select="Title"/></a>
</td>
</tr>
</xsl:for-each>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------