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

CSS样式表
CSS的margin边界叠加深度剖析图文演示
CSS中Float(浮动)相关技巧文章
惊现学习CSS应该注意的方法
使用text-align:justify实现两端对齐一例
CSS整体布局声明的一些使用技巧
推荐深入理解css中的position定位和z-index属性
固定表格的高度超过指定高度就隐藏的方法
推荐个Css的filter常用滤波器属性及语句大全
用css滤镜实现的文字描边效果的代码
用css实现的带阴影的表格效果的代码
推荐个不错的表单Input的高级用法11例
flash幻灯片需要先激活ActiveX控件才能使用的又一个办法
DIV+CSS作网页容易犯的错误小结
ul+li及css制作韩国风格菜单代码
div布局的自由伸展三栏式版面的代码
几乎被设计师遗忘了的标签fieldset legend
不用javascript实现带序号的表格隔行换色的效果
用CSS实现基本条状图表效果
用javascript来控制 链接的target 属性的代码
多浏览器css兼容分析小结

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 80 ::
收藏到网摘: 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.