<% '******************************************************* '* ASP 101 Sample Code - http://www.asp101.com/ * '* * '* This code is made available as a service to our * '* visitors and is provided strictly for the * '* purpose of illustration. * '* * '* http://www.asp101.com/samples/license.asp * '* * '* Please direct all inquiries to webmaster@asp101.com * '******************************************************* %> <% Dim objXML Dim objXSL Dim strHTML ' Load the XML File ' The "ServerHTTPRequest" line tells the XML processor that ' the file is to be retrieved from a remote server via HTTP. ' Please note that this code will not work for you until you ' replace our internal address (10.2.3.180) with www.asp101.com. Set objXML = Server.CreateObject("MSXML2.DOMDocument") objXML.async = False objXML.setProperty "ServerHTTPRequest", True objXML.load("http://10.2.3.180/samples/xmlxsl.xml") ' Load the XSL File ' In most cases I would think this would be local so I'm still ' pulling the stylesheet from the file system, but the code to ' retreive it via HTTP is simply commented out below: Set objXSL = Server.CreateObject("MSXML2.DOMDocument") objXSL.async = False ' Local (via file system) objXSL.load(Server.MapPath("xmlxsl.xsl")) ' Remote (via HTTP) 'objXSL.setProperty "ServerHTTPRequest", True 'objXSL.load("http://10.2.3.180/samples/xmlxsl.xsl") ' Transform the XML file using the XSL stylesheet strHTML = objXML.transformNode(objXSL) Set objXML = Nothing Set objXSL = Nothing ' Spit out the resulting HTML... the data comes from the ' .xml file, but the formatting of the results depends ' completely upon the .xsl file. Response.Write strHTML %>