// Load XML var xml = new ActiveXObject("Microsoft.XMLDOM") xml.async = false xml.load("cd_catalog.xml") // Load the XSL var"/> // Load XML var xml = new ActiveXObject("Microsoft.XMLDOM") xml.async = false xml.load("cd_catalog.xml") // Load the XSL var">

Home  >  Article  >  Backend Development  >  Detailed introduction (javascript+asp) XML, XSL conversion output HTML sample code

Detailed introduction (javascript+asp) XML, XSL conversion output HTML sample code

黄舟
黄舟Original
2017-03-15 17:00:371565browse

Detailed introduction (javascript+asp)XML, XSL conversion output HTML sample code

code As follows:

<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 server conversion

The code is as follows:

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


The above is the detailed content of Detailed introduction (javascript+asp) XML, XSL conversion output HTML sample code. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn