Subject: | XML::SAX::RTF should not register as an XML parser |
The Makefile.PL script in the XML-SAX-RTF-0.1 distribution includes a call to XML::SAX->add_parser which registers XML::SAX::RTF in ParserDetails.ini.
This is a problem because the last module registered in ParserDetails.ini becomes the default SAX parser for XML. If the module cannot parse XML then any attempt to parse XML using SAX from that point on will fail.
Some example failures caused by XML::SAX::RTF being the default parser:
http://www.nntp.perl.org/group/perl.cpan.testers/131181
http://www.nntp.perl.org/group/perl.cpan.testers/120169
http://www.nntp.perl.org/group/perl.cpan.testers/76917
An example of another module which generates SAX events from a non-XML
source (and does not register in ParserDetails.ini):
http://search.cpan.org/src/MSERGEANT/XML-Generator-DBI-1.00/Makefile.PL
I've attached a patch which simply removes the relevant section of Makefile.PL.
I haven't actually used XML::SAX::RTF myself, but I suspect the POD also needs an update to reflect that the new() method should be called directly to create an RTF parser object rather than using XML::SAX::ParserFactory.
Regards
Grant
--- Makefile.PL-orig Tue Apr 6 21:20:30 2004
+++ Makefile.PL Tue Apr 6 21:20:30 2004
@@ -6,15 +6,3 @@
'PREREQ_PM' => { 'XML::SAX' => 0 } # require XML::SAX
);
-
-sub MY::install {
- package MY;
- my $script = shift->SUPER::install(@_);
- $script =~ s/install :: (.*)$/install :: $1 install_sax_driver/m;
- $script .= <<"INSTALL";
-install_sax_driver :
-\t\@\$(PERL) -MXML::SAX -e 'XML::SAX->add_parser(q(\$(NAME)))->save_parsers();'
-
-INSTALL
- return $script;
-}