in reply to How do you get attribute values using XML::LibXML

Hi,
Method findnodes of XML::LibXML::XPathContext will return an array of elements or a XML::LibXML::NodeList object in case of scalar context.

So In above case, variable $section is a object of XML::LibXML::Element. Method getAttribute will return a scalar value if element has value of specified attribute.

So in above example $username has string value, not an element.

Thanks
Dhaval Patel

  • Comment on Re: How do you get attribute values using XML::LibXML