Re: XML:LibXML::XPathContext problem
Nic Gibson <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
On 20 Jun 2008, at 13:10, Robin Berjon wrote:
> On Jun 20, 2008, at 12:44, Nic Gibson wrote:
>> Can't locate object method "new" via package
>> "XML::LibXML::XPathContext" at /Users/nicg/src/Penguin/bin/
>> epub_data.pl line 80.
>
> If you create a small self-contained script that just tests reading
> a trivial XML document and running an XPath against it, does it work?
Interestingly, not only does xpath against a node work fine but...
use strict;
use XML::LibXML;
use XML::LibXML::XPathContext;
my $parser = XML::LibXML->new;
my $doc = $parser->parse_file('pagemap.xml');
my $context = XML::LibXML::XPathContext->new($doc);
my $test = $context->findvalue('//page[@name="45"]/@href');
print "$test\n";
works fine which gives me pause for thought at least.
cheers
nic
>
>
> --
> Robin Berjon - http://berjon.com/
> ------------------------------------------------------------------------
> "How vulgar, this hankering after immortality, how vain, how false.
> Composers are merely scribblers of cave paintings. One writes music
> because winter is eternal and because if one didn't, the wolves and
> blizzards would be at one's throat all the sooner."
> -- David Mitchell, Cloud Atlas
>
>
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs