How can I access attributes and elements from XML::LibXML in Perl?
I am having trouble understanding / using name spaces with XML::LibXML package in Perl. I can access an element successfully but not an attribute. I have the following code which accesses an XML file ( http://pastebin.com/f3fb9d1d0 ). my $tree = $parser->parse_file($file); # parses the file contents into the new libXML object. my $xpc = XML::LibXML::XPathContext->new($tree); $xpc->registerNs(microplateML => 'http://moleculardevices.com/microplateML'); I then try and access an element called common-name and an attribute called name. foreach my $camelid ($xpc->findnodes('//microplateML:species')