Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: error : can't locate object method "getAttribute" via package XML::DOM::NodeList

by Corion (Patriarch)
on Sep 27, 2016 at 08:12 UTC ( [id://1172722]=note: print w/replies, xml ) Need Help??


in reply to error : can't locate object method "getAttribute" via package XML::DOM::NodeList

Where do you find the method ->getAttribute documented for a XML::DOM::NodeList? It doesn't make sense to ask for the attributes of a list. Maybe you want to extract the first item from that list and ask for its attribute?

Replies are listed 'Best First'.
Re^2: error : can't locate object method "getAttribute" via package XML::DOM::NodeList
by ankit.tayal560 (Beadle) on Sep 27, 2016 at 08:55 UTC

    http://search.cpan.org/~tjmather/XML-DOM-1.46/lib/XML/DOM.pm : in XML::DOM classes section goto XML::DOM::Element. there it is documented. and config is itself an element/tag infact it is the root element of the .xml file?

      Yes, that function makes sense and is documented for an XML::DOM::Element. But what ->getElementsByTagName returns is not a single XML::DOM::Element object. Please refer to the SYNOPSIS section of XML::DOM to see the correct usage.

        can you please provide me some code to parse this xml file and get the different attributes?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1172722]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-03-19 04:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found