Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

How to specify required XML::SAX features in Makefile.PL

by voj (Acolyte)
on Jan 17, 2012 at 12:44 UTC ( #948311=perlquestion: print w/ replies, xml ) Need Help??
voj has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I changed a CPAN module to now use XML::SAX with XML Namespaces. Unfortunately it fails on CPAN testers with the error message "Unable to provide required features" thrown by SAX::XML at:
my $parser = XML::SAX::ParserFactory->new( RequiredFeatures => { '' => 1 } )->parser( Handler => $self );
In my Makefile.PL's PREREQ_PM I just require: XML::SAX' => '0.96' XML::SAX contains I pure Perl parser with support of namespaces, I don't know why this is not used on the test machines. Maybe there is some problem in /usr/local/share/perl/5.10.1/XML/SAX/ParserDetails.ini, but I don't have a clue to specify my requirement (just a namespace-aware SAX parser) in Makefile.PL. Here are my failing test: I found the problem in other modules too, for instance:

Comment on How to specify required XML::SAX features in Makefile.PL
Select or Download Code
Replies are listed 'Best First'.
Re: How to specify required XML::SAX features in Makefile.PL
by Khen1950fx (Canon) on Jan 17, 2012 at 20:04 UTC

    Some good news: I got your module to install, and all the tests passed. The problem was with XML::SAX::ParserFactory. It must be listed in PREREQ_PM in addition to XML::SAX. You had XML::SAX 0.96, but you also need XML::SAX::ParserFactory 1.01.

    Here's the modified Makefile:
    use 5.005; use strict; use ExtUtils::MakeMaker; &WriteMakefile( NAME => 'PICA::Record', DISTNAME => 'PICA-Record', VERSION_FROM => 'lib/PICA/', ABSTRACT_FROM => 'lib/PICA/', PMLIBDIRS => [ qw( lib/ ) ], AUTHOR => 'Jakob Voss <>', PREREQ_PM => { 'LWP::Simple' => '1.0', 'URI::Escape' => '1.35', 'SOAP::Lite' => '0.71', 'Scalar::Util' => '1.14', 'Config::Simple' => '4.58', 'PerlIO' => '1.0', 'IO::File' => '1.11', 'IO::Scalar' => '1.126', 'Encode' => '2.33', 'XML::SAX' => '0.96', 'XML::SAX::ParserFactory' => '1.01', 'XML::Writer' => '0.605', 'DBI' => '1.0', 'DBD::SQLite' => '1.23', 'Unicode::Normalize' => '0.23', 'String::Escape' => '0', }, EXE_FILES => [ 'script/parsepica', 'script/picaimport', 'script/winibw2pica', ], dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, depend => { Makefile => '$(VERSION_FROM)' }, clean => { FILES => 'PICA-Record-*' }, );
Re: How to specify required XML::SAX features in Makefile.PL
by grantm (Parson) on Jan 18, 2012 at 03:31 UTC

    As the (very remiss) maintainer of XML::SAX, I'm also mystified by the reports you're seeing. If XML::SAX was properly installed, then there would be at least one parser module that meets the requirements you've specified.

    One way to get more information would be to have one of your early test files emit more diagnostic information via the Test::More 'diag()' function. For example, it would be interesting to know what the default parser is on those servers (the class of the value returned when XML::SAX::ParserFactory->new is called with no extra requirements). It would also help to know what is actually in the ParserDetails.ini file but the exact pathname to the file will be different on each host and working it out requires replicating the %INC gymnastics from

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://948311]
Approved by moritz
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2015-11-25 01:56 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (667 votes), past polls