Home > Backend Development > XML/RSS Tutorial > An example source code of interaction between Asp and XML

An example source code of interaction between Asp and XML

陈政宽~
Release: 2017-06-28 13:57:46
Original
4048 people have browsed it

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";>



each select="PERSONNEL/PERSON">










< ;xsl:otherwise match=".[FG='girl']">
<font color="red">
















  • testXML.xml:

    The code is as follows:





    Male
    boy


    Female
    girl

    < PERSON>
    Haha, this is hard to say
    donot know




    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!

    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template