Making Asp interact with XML is a standard extension language and a standard for Web programming in the future. asp is one of the widely used web programming languages. can they be combined to play a role? Here we will provide you with a very simple example of the limited length and knowledge of XML and XSL. tofu is not here to show ugly. The following describes the content of several files that need to be used.
TestXsl. xsl:
TestXML. xml:
Male
Boy
Female
Girl
Well, this is not easy to say.
Donot know
TestXML. asp
<% 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)) %>
Let's take a look at the testXML. asp file.
Set xml = Server. CreateObject ("Microsoft. XMLDOM ")
Set xsl = Server. CreateObject ("Microsoft. XMLDOM ")
Used to create an xml and xsl instance respectively. xml. load (server. mappath ("testXML. xml") is used to load
Xml file containing data. xsl. load (server. mappath ("testXSL. xsl") is used to load xsl containing data rules.
File, and use xml. transformNode (xsl) to use the preceding rules in the XML file.
The preceding figure shows how to make Asp interact with XML. For more information, see other related articles in the first PHP community!