Create an XML File From a Database (2)
You also can use ASP with XML DOM and an XSLT file to transform an XML file
to XHTML on the server:
<%
'Load XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(Server.MapPath("my.xml"))
'Load XSL
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("my.xsl"))
'Transform file
Response.Write(xml.transformNode(xsl))
%>
In the example above, 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 file into memory;
The last line of code transforms the XML document using the XSL document, and
sends the result as XHTML to your browser.
|