|
|
Transforming XML with XSLT on the Server - XML
|
Views : 281
|
|
Tagged in : XML
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
Transforming XML with XSLT on the Server
****************************************
This ASP transforms an XML file to XHTML on the server:
<%
'Load XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(Server.MapPath("simple.xml"))
'Load XSL
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("simple.xsl"))
'Transform file
Response.Write(xml.transformNode(xsl))
%>
Example explained
* 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. Nice!
|
|
By satheesh, On - 2010-02-04 |
|
|
|