The ASP file with VB code to transform XML to HTML

The first block of code creates an instance of the Microsoft XML parser (XMLDOM), and loads the XML file into memory. The second block of code creates another instance of the parser and loads the XSL document into memory. The last line of code transforms the XML document using the XSL document, and returns the result to the browser.

A good web site for XML information is www.xml101.com, and they get credit for this transformation code.

Because my server does not handle ASP, I cannot do a working demonstration of the transformation on the server using this script, and will post another technique to accomplish a server transformation.


<%
'Load the XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(Server.MapPath("home_style.xml"))

'Load the XSL
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("relml.msxsl"))

Response.Write(xml.transformNode(xsl))
%>