Problem while parsing Simple XML files

Discussion in 'ASP' started by rag84dec, Aug 28, 2008.

  1. rag84dec

    rag84dec New Member

    Joined:
    Jul 17, 2007
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    0
    I have an XML file "r1.xml"
    Code:
    <root>
        <val>Value1</val>
        <val1>value2</val1>
    </root>
    

    I have an ASP script file as below
    Code:
    dim rootName12
    
     Set objXML = Server.CreateObject("Microsoft.XMLDOM")
     Set objLst = Server.CreateObject("Microsoft.XMLDOM")
     objXML.async = False
     objXML.Load (Server.MapPath("r1.xml"))
     If objXML.parseError.errorCode <> 0 Then
    	 'handle the error
     End If
     
    Set rootName12 =  objXML.documentElement
    
    Set nm= rootName12.childNodes.item(0).tagName [B]' I am 'getting error here[/B]
    

    But i am getting an error like this

    Microsoft VBScript runtime (0x800A01A8)
    Object required: 'rootName12'




    Can anyone help???

    thanks
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice