XML is a standard extension language and the standard for future Webprogramming. ASP is one of the widely circulated webprogramming languages. Can they be combined to play a role? What's the role? Tofu is here to provide you with a very simple source example of interaction between Asp and XML. Regarding XML and XSL, due to the limited space and knowledge level, Tofu will not show off here. First, let’s talk about the contents of several files that need to be used.
testXsl.xsl:
The code is as follows:
< ;xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>
< ;xsl:otherwise match=".[FG='girl']">
<font color="red">
testXML.xml:
The code is as follows:
< PERSON>
testXML.asp
The code is as follows:
<%
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(server.mappath("testXML.xml"))
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(server.mappath("testXSL.xsl"))
Response.Write( xml.transformNode(xsl))
%>
Contrast this example, let’s mainly talk about the testXML.asp file
set xml = Server.CreateObject("Microsoft .XMLDOM")
set xsl = Server.CreateObject("Microsoft.XMLDOM")
Used to create an instance of xml and xsl respectively, where xml.load(server.mappath("testXML.xml")) Used to load
xml files containing data, xsl.load(server.mappath("testXSL.xsl")) is used to load xsl
files containing data rules, and finally use xml.transformNode(xsl) to convert the previous The rules are used in XML files.
The above is the detailed content of An example source code of interaction between Asp and XML. For more information, please follow other related articles on the PHP Chinese website!