Let ASP interact with XML
Standard, ASP is now widely circulated in one of the Web programming languages, can not let them
Two together to play a role? Tofu is here to provide a very simple example
About XML and XSL limited to space and knowledge level tofu's not here, shortcoming.
Let's start with the contents of a few files that need to be used.
Testxml.xml:
<?xml version= "1.0" encoding= "gb2312"?>
<PERSONNEL>
<PERSON>
<NAME> male </NAME>
<FG>boy</FG>
</PERSON>
<PERSON>
<NAME> Women </NAME>
<FG>girl</FG>
</PERSON>
<PERSON>
<NAME> Oh, this is not easy to say </NAME>
<fg>donot know</fg>
</PERSON>
</PERSONNEL>
Testxml.asp
<%
Set xml = Server.CreateObject ("Microsoft.XMLDOM")
Xml.async = False
Xml.load (Server.MapPath ("Testxml.xml"))
In contrast to this example, we 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 separately, where Xml.load (Server.MapPath
("Testxml.xml")) Used to load
The XML file that contains the data, Xsl.load (Server.MapPath ("testxsl.xsl")) is used to load the containing
XSL for data rules
file, eventually using Xml.transformnode (XSL) to use the preceding rule in the XML file
Run the demo in:
Http://www.asp888.net/study/testXML.asp
Download of the entire file in: Http://www.asp888.net/download/asp/xml/testXML.zip
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.