XML::LibXML::Reader Can't Find Method. libxml2 anyone?

J

Jerry Krinock

I need to use Perl module XML::LibXML::Reader [1]. My web host has it
installed. However, when I simply invoke it to create a new object, I
get an error message from within the module:

Can't locate object method "_newForString" via package
"XML::LibXML::Reader" at /usr/lib/perl5/site_perl/5.8.8/i686-linux/XML/
LibXML/Reader.pm line 159.

Checking the source, I find that indeed _newForString is called at
line 159 and not defined anywhere.

The XML::LibXML::Reader documentation states that it "requires at
least libxml2-2.6.21". So, I thought: Maybe my web host does not have
this prerequisite installed?

I then installed XML::LibXML::Reader on my local Macintosh and ran my
script there, but got the same result. My Mac has a 4.2-megabyte /usr/
lib/libxml2.2.dylib. Admittedly, I don't understand much about this,
but I thought that these dylibs were only available to programs
written in C, not scripts. What should I be looking for?

Of course, the problem could be in my code, shown below, but I don't
see how because the bomb at line 159 is when the constructor simply
tries to hand off my string argument, before anything substantive is
done.

Thank you,

Jerry Krinock

[1] http://search.cpan.org/dist/XML-LibXML/lib/XML/LibXML/Reader.pod

[2] ***** TestSS.pl *****

#!/usr/local/bin/perl

my $string = q{<?xml version="1.0" encoding="UTF-8"?>
<new-order-notification xmlns="http://checkout.google.com/schema/2"
serial-number="403468137391754-00001-7">
<timestamp>2008-07-25T14:20:57.237Z</timestamp>
<shopping-cart>
<items>
<item>
<item-name>Bookmarksman</item-name>
</item>
</items>
</shopping-cart>
</new-order-notification>} ;

use XML::LibXML::Reader ;
my $reader = XML::LibXML::Reader->new(string => $string) ;
while ($reader->read) {
print "Parsed node name: $reader->name\n" ;
}
 
J

Jerry Krinock

Well, after my web host decided to loosen up and give me shell access,
and read the logs, I was able to find the problem. It was in my
code: "You are not defining a location, string, IO, DOM or FD". I
had directed STDERR to a separate log file, but for some reason it
gave me only that other error, which set me on the wrong
troubleshooting path.

Thanks for reading!

Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top