Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jdavidb (1361)

jdavidb
  (email not shown publicly)
http://voiceofjohn.blogspot.com/

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Friday August 30, 2002
07:11 AM

Matt, be proud of me

[ #7413 ]

I'm reading XML::SAX::Intro this morning. Something in me told me it's finally time.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • XML::SAX::Intro contains the following example:

    use XML::SAX;
    use MySAXHandler;

    my $parser = XML::SAX::ParserFactory->new(
        Handler => MySAXHandler->new
    );

    $parser->parse_uri("foo.xml");

    I've got almost exactly that, with MySAXHandler defined as a subclass of XML::SAX::Base with no overridden methods, and I get:

    Can't locate object method "parse_uri" via package "XML::SAX::ParserFactory"

    I'm sure I'll figure this out somehow...

    --
    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • And here it is! Typo in the docs; instead of calling the new method of the XML::SAX::ParserFactory class, you're supposed to call the parser method, according to the XML::SAX::ParserFactory POD.

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • Glad to see you found the answer to your problem :) Please also note that you don't need to (and in fact probably shouldn't) inherit from XSB for Handlers. It's only for Drivers and Filters. What happened is that we optimised for the most common case, which is the Handler. So all you need there is the methods that you wish to use, *nothing* else.

      --

      -- Robin Berjon [berjon.com]