This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
html inside xml
Dear Jeni,
I have a question which stuck me for a while, I use Microsoft.XMLDOM to
generate xml files, and display over the server. The html information for
the product is stored in the SQL server. While I extract the html content
from the database and append to an xml node, the Microsoft.XMLDOM
automatically convert the "<" and ">" tags into "& lt;" and "& gt;" ( I put
a space between & and "lt; gt;" otherwise the browser will display "<" and
">" automatically), which make my xml file looks as this:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"?>
<report>
<row>
<column><caption>ID</caption>
<!---the html data content from the database--->
<value><FONT COLOR="RED"& gt;& lt;B& gt;ABC& lt;/B& gt;&
lt;/FONT& gt;
</value>
</column>
</row>
</report>
The xsl I use is like this:
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="report">
<table>
<xsl:for-each select="row">
<tr>
<xsl:for-each select="column">
<td><xsl:copy-of select="value"/></td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The output I get is not what I really want:
ID <FONT COLOR="RED"><B>ABC</B></FONT>
Should any suggestions and advice will be most appreciated.
Many thanks
Henry
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list