把 CDATA 中的內(nèi)容(有可能是不規(guī)范的Html代碼)以Html方式展現(xiàn)出來(lái)。
更新時(shí)間:2007年04月22日 00:00:00 作者:
前不久我寫過 XML+XSL 與 Html 的結(jié)合 文章,之后有人問我如何把 CDATA 中的內(nèi)容以Html方式展現(xiàn)出來(lái)(尤其是用戶寫的Html不規(guī)范)。本來(lái)想寫個(gè)范例,后來(lái)到Google上一查,發(fā)現(xiàn)已經(jīng)有人寫了。就在:http://java.blogger.cn/wuyu/posts/1460.aspx
注意:xsl的disable-output-escaping="yes"
其核心就是利用 disable-output-escaping="yes"
MSDN 上對(duì)它的描述如下:
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.
注意:xsl的disable-output-escaping="yes"
其核心就是利用 disable-output-escaping="yes"
MSDN 上對(duì)它的描述如下:
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.
相關(guān)文章
使用CSS框架布局的缺點(diǎn)和優(yōu)點(diǎn)小結(jié)
本篇文章主要介紹了使用CSS框架布局的缺點(diǎn)和優(yōu)點(diǎn)小結(jié),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來(lái)看看吧2007-12-12
有時(shí)候圖片太大,會(huì)破環(huán)網(wǎng)頁(yè)整齊的布局。這時(shí)可以用css來(lái)強(qiáng)制按比例壓縮圖片的高度或?qū)挾取?/div> 2008-06-06
超級(jí)連接的提示中換行效果實(shí)現(xiàn)代碼
前段時(shí)間有網(wǎng)友在論壇發(fā)帖問"如何實(shí)現(xiàn)超級(jí)連接的多行顯示",其實(shí)方法很簡(jiǎn)單就是使用title 和 alt就可以實(shí)現(xiàn)。2008-05-05
轉(zhuǎn)載未知大小的圖片在一個(gè)已知大小容器中的水平和垂直居中(二)
轉(zhuǎn)載未知大小的圖片在一個(gè)已知大小容器中的水平和垂直居中(二)...2007-01-01
XHTML下css+div布局總結(jié) 超強(qiáng)推薦
XHTML下css+div布局總結(jié) 超強(qiáng)推薦...2006-12-12最新評(píng)論

