有关xml和xslt转换时html标签处理求助

我希望转换后html标签有效,可是,唉......


tmp.xml文件:

1<root>
2<title>题目</title>
3<content><![CDATA[<font size=4 color=blue>这是蓝色汉字</font><br><input type=button value="这是一个按钮">]]></content>
4</root>


tmp.xsl

 1<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
 2<xsl:template match="text()">
 3<xsl:value-of></xsl:value-of>
 4</xsl:template>
 5<xsl:template match="/">
 6<xsl:apply-templates select="root"></xsl:apply-templates>
 7</xsl:template>
 8<xsl:template match="/root">
 9<html>
10<head>
11<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><title><xsl:value-of select="title"></xsl:value-of></title>
12</head>
13<body>
14<xsl:value-of select="content"></xsl:value-of>
15</body>
16</html>
17</xsl:template>
18</xsl:stylesheet>

我从IE5.0中看到的效果是

1<font color="blue" size="4">这是蓝色汉字</font>
1<br/>
1<input type="button" value="这是一个按钮"/>

问题出在样式转换时他竟然把我的数据文件中的尖括号转换成“$lt;”和“$gt;”。
请知情者予以帮助
---------------------------------------------------------------

1<xsl:for-each select="content">
2<xsl:eval no-entities="t">this.nodeTypedValue</xsl:eval>
3</xsl:for-each>
Published At
Categories with Web编程
comments powered by Disqus