xml内容中含有HTML标签如何处理

第一种方式:
用<![CDATA[]]

<
templates>
<template>
<![CDATA[<html><head>$title</head><body>$content<body></html>]]>
 
</template>
</templates>

第二种方式:
用xsl
<table id ="tblContent" class="xl_ys" style="width:100%; z-index:100; position: absolute;"> 
<
xsl:for-each select="Table">
<tr> <!--td中单击时选择当前值, 鼠标在上时更改行背景颜色,鼠标离开后清除背景颜色-->
<
td id="td_MedNameCode" onclick="selValue(this.parentElement)" style="cursor:hand; width:30px" onmouseover="this.parentElement.style.backgroundColor='#3366CC'" onmouseout="clearColor()">
<
xsl:value-of select="MedNameCode"/>
</
td>
<
td id ="td_MedicineName" onclick="selValue(this.parentElement)" style="cursor:hand; width:40px" onmouseover="clearColor();this.parentElement.style.backgroundColor='InfoBackground'" onmouseout="clearColor()">
<xsl:value-of select="MedicineName" />
</
td>
<td id ="td_Medicine_ID" style="display:none">
<
xsl:value-of select="Medicine_ID"/>
</
td>
<tr>
</xsl:for-each>
</
table>

posted @ 2011-05-05 10:05  Byrd  阅读(2192)  评论(0编辑  收藏  举报