// Load XML var xml = new Acti">
您的位置:首页 > 技术中心 > 其他 >

详细介绍(javascript+asp)XML、XSL转换输出HTML的示例代码

时间:2017-03-15 17:00

详细介绍(javascript+asp)XML、XSL转换输出HTML的示例代码

代码如下:

<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)) 
%>

以上就是详细介绍(javascript+asp)XML、XSL转换输出HTML的示例代码的详细内容,更多请关注gxlsystem.com其它相关文章!

本类排行

今日推荐

热门手游