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

(编辑:jimmy 日期: 2024/9/21 浏览:2)

前不久我写过 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.

一句话新闻
微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。