OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [xml-dev] DOM



Title: DOM
Something like this...
 
    Dim xmldoc As New MSXML2.DOMDocument
    
    xmldoc.Load "c:\temp\test.xml"
 
    Dim firstnames As MSXML2.IXMLDOMNodeList
    Set firstnames = xmldoc.getElementsByTagName("firstname")
   
    Dim i As Integer
    i = 0
    Do While i < firstnames.Length
        Response.write firstnames.Item(i).text
        i = i + 1
    Loop
 
--tim
-----Original Message-----
From: Avital Nagar [mailto:Avital@cellact.com]
Sent: Monday, October 08, 2001 6:41 AM
To: xml-dev@lists.xml.org
Subject: [xml-dev] DOM

If I have an xml document that looks like this:

<shop>

        <location> US </location>

        <books>

                <title> Snow White </title>

                <author>

                        <firstname> Liza </firstname>

                        <lastname> Baker </lastname>

                </author>

                <author>

                        <firstname> Tanith </firstname>

                        <lastname> Lee </lastname>

                </author>

       

        </books>

</shop>

How can I get the firstnames? I have to display only the first name in asp. I know I have to use something with getelementsbytagname and firstChild.