优质中文开源软件代码项目资源技术共享平台
传播开源的理念,推广开源项目
学习是对自己最棒的投资!与君共勉!

网站首页 > web开发 > XML 正文

(javascript+asp)XML、XSL转换输出HTML

longtao100 2021-07-16 XML 608 ℃ 0 评论
Javascript客户端转换

复制代码
代码如下:

<html>
<body>
<script language="javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("cd_catalog.xml")
// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("cd_catalog.xsl")
// Transform
document.write(xml.transformNode(xsl))
</script>
</body>
</html>

Asp服务端转换

复制代码
代码如下:

<%
'Load the XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(Server.MapPath("cd_catalog.xml"))
'Load the XSL
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("cd_catalog.xsl"))
'Transform the file
Response.Write(xml.transformNode(xsl))
%>

Tags:XMLXSLHTML

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

请填写验证码
开源分类
最近发表
开源网标签
开源网归档