weismat has asked for the wisdom of the Perl Monks concerning the following question:
This fails as no nodes are found. When manually walking through the tree I see that the namespace using $doc->firstChild->nameSpaceURI. How do I add the found name space, so that the XPATH query gives the wanted result - I guess that Sketchpath handles this automatically. The XML look like this <?xml version="1.0" encoding ="UTF-8"?><xxx xmlns="http://xxx><yyy>zzz</yyy></xxx> The query is a simple /xxx/yyy (sorry - missed this when simplyfying the xml.my $parser=XML::LibXML->new(); my $doc=$parser->parse_file($file); foreach my $node($doc->findnodes($xpathQuery));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Lib XML question
by ikegami (Patriarch) on Oct 22, 2009 at 08:31 UTC | |
by weismat (Friar) on Oct 22, 2009 at 08:47 UTC | |
|
Re: XML::Lib XML question
by ikegami (Patriarch) on Oct 22, 2009 at 08:23 UTC | |
|
Re: XML::Lib XML question
by Corion (Patriarch) on Oct 22, 2009 at 08:27 UTC | |
by weismat (Friar) on Oct 22, 2009 at 08:33 UTC |