1. test.xml
<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet href="test.xsl" type="text/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[]]></more>
<comment-link>http://alazanto.org/xml/archives/000033_comments.xml</comment-link>
<comment-count>6</comment-count>
</entry>
2. test.xsl
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/entry">
<html>
<head>
</head>
<body>
<xsl:value-of select="title" />
<xsl:value-of select="body" disable-output-escaping="yes"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
关键之外在于使用的命名空间xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 和输出时加上disable-output-escaping="yes"
相关文章:
1. Flutter刷新组件RefreshIndicator自定义样式demo2. JavaScript判断两个数组相等的4类方法总结3. Echarts通过dataset数据集实现创建单轴散点图4. echart在微信小程序的使用简单示例5. 详解JavaScript中数组的一些特殊用法6. JavaScript深拷贝方法structuredClone使用7. 使用uniapp打包微信小程序时主包和vendor.js过大解决(uniCloud的插件分包)8. 使用Node.js实现Clean Architecture方法示例详解9. js的一些潜在规则使用分析10. js的一些潜在规则示例分析