使用XSL将XML文档中的CDATA注释输出为HTML文本    

示例代码

1. test.xml




entry with images
August 09, 2003
Kevin
000033
http://alazanto.org/xml/archives/000033.xml
class="archive" align="right" src="http://alazanto.org/images/sample.jpg"
alt="photograph of a flower, just for show"/>Mauris felis elit, varius
quis, pulvinar vel, sodales vehicula, mi. Nunc elementum pharetra elit.

]]>


http://alazanto.org/xml/archives/000033_comments.xml
6

2. test.xsl












关键之外在于使用的命名空间xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 和输出时加上disable-output-escaping="yes"

关联文档