把 CDATA 中的內(nèi)容(有可能是不規(guī)范的Html代碼)以Html方式展現(xiàn)出來(lái)。
更新時(shí)間:2007年04月22日 00:00:00 作者:
前不久我寫(xiě)過(guò) XML+XSL 與 Html 的結(jié)合 文章,之后有人問(wèn)我如何把 CDATA 中的內(nèi)容以Html方式展現(xiàn)出來(lái)(尤其是用戶寫(xiě)的Html不規(guī)范)。本來(lái)想寫(xiě)個(gè)范例,后來(lái)到Google上一查,發(fā)現(xiàn)已經(jīng)有人寫(xiě)了。就在: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é),小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2007-12-12JAVASCRIPT IE 與 FF 中兼容寫(xiě)法記錄
下面是高手整理的一些javascript在ie和ff中的兼容寫(xiě)法2008-10-10- 有時(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ā)帖問(wèn)"如何實(shí)現(xiàn)超級(jí)連接的多行顯示",其實(shí)方法很簡(jiǎn)單就是使用title 和 alt就可以實(shí)現(xiàn)。2008-05-05用CSS開(kāi)發(fā)時(shí)髦的導(dǎo)航欄第二篇
我能夠使用CSS和列表創(chuàng)造有子菜單的導(dǎo)航欄嗎? 有時(shí)候我們需要超過(guò)一級(jí)的導(dǎo)航欄 – 可是在CSS里面用樣式化的列表能夠創(chuàng)建多級(jí)導(dǎo)航欄嗎?2008-05-05轉(zhuǎn)載未知大小的圖片在一個(gè)已知大小容器中的水平和垂直居中(二)
轉(zhuǎn)載未知大小的圖片在一個(gè)已知大小容器中的水平和垂直居中(二)...2007-01-01XHTML下css+div布局總結(jié) 超強(qiáng)推薦
XHTML下css+div布局總結(jié) 超強(qiáng)推薦...2006-12-12最新評(píng)論