当前位置: 首页 > 图文教程 > 网页制作 > CSS样式表 > 把 CDATA 中的内容(有可能是不规范的Html代码)以Html方式展现出来。

CSS样式表
shtml精简教程让你知道什么是shtml
很不错的 CSS Hack 又学了一招
Default style sheet for HTML 4
资料:Unicode 汉字内码对应表
解决CSS中 display 与 visibility 的区别
制作WEB在线编辑器-插入HTML标签
编写纯 CSS 弹出菜单的原理及实现 By shawl.qiu
关于《精通css》之几个不错的注意事项
position:relative/absolute无法冲破的等级
CSS样式表常用小技巧收藏
收集的web页面html中常用的特殊符号大全
bc1998录制的css视频教程推荐新手看下
dl+ol应用分析
li的简单应用
web打印的另类方法
用CSS实现的一张图完成的按钮效果
文章内容页广告浮于左上角的解决办法
广告放在文章页左上角的解决办法二
iframe的使用用法
FIF互动帮助手册系列-HTML手册 flash版

CSS样式表 中的 把 CDATA 中的内容(有可能是不规范的Html代码)以Html方式展现出来。


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 62 ::
收藏到网摘: n/a

前不久我写过 XML+XSL 与 Html 的结合 文章,之后有人问我如何把 CDATA 中的内容以Html方式展现出来(尤其是用户写的Html不规范)。本来想写个范例,后来到Google上一查,发现已经有人写了。就在:http://java.blogger.cn/wuyu/posts/1460.aspx

注意:xsl的disable-output-escaping="yes"
其核心就是利用 disable-output-escaping="yes"
MSDN 上对它的描述如下:
disable-output-escaping
Default is "no". If the value is "yes", a text node generated by instantiating the element will be output without any escaping. For example, the following generates the single character "<".
<
Note?? disable-output-escaping="yes" can be used to generate non-well-formed documents, and thus should be used with caution, because non-well-formed output may generate errors in certain circumstances. For example, transformNodeToObject to an XML document requires that the result be well-formed and thus may not complete ifdisable-output-escaping has affected the well-formedness of the document. Consider disable-output-escaping="yes" an advanced feature to be used only when the potential dangers are understood.