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:
<% '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)) %>
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!