Bob,
I have tried both lines:
my $title = XML::RSS::Parser->ns_qualify('title',$feed->rss_namespace_uri);
and
my $title = $p->ns_qualify('title',$feed->rss_namespace_uri);
I will try and make sure everything that is installed is up-to-date,
then I will contact the author as my next step and then send the
result on to the list for archiving.
Thanks for the tip,
Craig
On Wed, 8 Dec 2004 08:29:37 -0500, Bob Showalter
<[EMAIL PROTECTED]> wrote:
> Craig Moynes wrote:
>
>
> > I installed XML::RSS:Parser from CPAN.
> > When I try to run a simple script I get (from the sample code):
> > Can't locate object method "ns_qualify" via package
> > "XML::RSS::Parser" at testrss3.pl line 11 (#1)
> > (F) You called a method correctly, and it correctly indicated a
> > package functioning as a class, but that package doesn't define
> > that particular method, nor does any of its base classes. See
> > perlobj.
> >
> > Uncaught exception from user code:
> > Can't locate object method "ns_qualify" via package
> > "XML::RSS::Parser" at testrss3.pl line 11.
> >
> > #!/usr/bin/perl -w
> >
> > use strict;
> > use XML::RSS::Parser;
> > use diagnostics;
> >
> > my $p = new XML::RSS::Parser;
> > my $feed = $p->parsefile('TV_shows.rss');
> >
> > # output some values
> > my $title =
> > XML::RSS::Parser->ns_qualify('title',$feed->rss_namespace_uri);
> > print $feed->channel->children($title)->value."\n"; print "item
> > count: ".$feed->item_count()."\n\n"; foreach my $i ( $feed->items ) {
> > map { print $_->name.": ".$_->value."\n" } $i->children;
> > print "\n";
> > }
> >
> >
> >
> > Some of my own (n00b) investigations show that the version on cpan,
> > and the version I installed from the cmd line too cpan are different,
> > the cpan cmd is version 3.01 I beleve, and the version on the web is
> > 2.15. It looks like the version downloaded uses a superclass
> > XML::Parser. Linux, Perl 5.8.5
> >
> > Anyone care to take a crack at this?
>
> Poking around at the source, it looks like ns_qualify is implemented in
> XML::Parser::Style::Elemental, so perhaps you need to call ns_qualify as a
> method of $p, your parser object.
>
> Have you asked the author of this thing?
>
--
Primer:
Shane Carruth: It's about some engineers that are trying to build a
device that "degrades" gravity. They find out it has unexplainable
properties. Hilarity ensues.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>