Source code of an Asp-XML interaction instance

Source: Internet
Author: User
XML is a scale-up language and the scale of Web programming in the future. asp is one of the widely-spread web programming languages. can we enable them to work together? Here we will provide you with a very simple example about XML and XSL.

XML is a scale-up language and the scale of Web programming in the future. asp is one of the widely-spread web programming languages. can we enable them to work together? Here we will provide you with a very simple example of the limited length and knowledge of XML and XSL. the tofu is not here to show ugly. next we will first talk about 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 identify the creation of an xml and xsl instance. 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. xml. transformNode (xsl) is used to apply the preceding rules to the XML file.



    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.