Knowledgebase
Using XMLDOM (MSXML)
Posted by Paul Woodland (Import) on 02 December 2006 04:35 AM

XMLDOM (MSXML) is an XML parser designed to allow the creation/manipulation of XML documents and data.  You can use the XMLDOM object to traverse an XML document and extract any needed information.

How do you use XMLDOM?
The following is an example of using XMLDOM to read a local XML file and output it's elements.

    <%
        'Create an instance of our XMLDOM object.
        Set xmlObj = Server.CreateObject("Microsoft.XMLDOM")
        xmlObj.Load Server.MapPath(".") & "\file.xml"

        'Get our root element (document element).
        Set xmlDoc = xmlObj.DocumentElement

        'Iterate through and output the element's text.
        For I = 0 To xmlDoc.ChildNodes.Length - 1
            Response.Write xmlDoc.ChildNodes.Item(I).Text
        Next       
    %>

(314 vote(s))
Helpful
Not helpful

Comments (0)