源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2021-10-02 08:54 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:使用XSL将XML文档中的CDATA注释输出为HTML文本
示例代码 1.   test.xml
[url=test.xsl]<entry>  <title>entry with images</title>  <date>August 09, 2003</date>  <author>Kevin</author>  <idnum>000033</idnum>  <permalink>http://alazanto.org/xml/archives/000033.xml</permalink>  <body xmlns:html="http://www.w3.org/1999/xhtml"><![CDATA[<p><img   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.   </p>]]>  </body>  <more xmlns:html="http://www.w3.org/1999/xhtml"><![CDATA[]]></more>  <comment-link>http://alazanto.org/xml/archives/000033_comments.xml</comment-link>  <comment-count>6</comment-count> </entry>
2.  test.xsl 关键之外在于使用的命名空间xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 和输出时加上disable-output-escaping="yes"
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部