Stopping PPM SAX Warnings

tomhukins on 2006-06-09T14:06:59

For my sins, I look after ActivePerl installations on several Windows machines including my desktop machine at work. If you don't sin enough to use Windows, the following won't interest you much.

Read on if you use PPM and regularly encounter error messages like:

Unable to recognise encoding of this document at C:/Perl/site/lib/XML/SAX/PurePerl/EncodingDetect.pm line 96, <$__ANONIO__> line 251.
Unable to recognise encoding of this document at C:/Perl/site/lib/XML/SAX/PurePerl/EncodingDetect.pm line 96, <$__ANONIO__> line 265.
Unable to recognise encoding of this document at C:/Perl/site/lib/XML/SAX/PurePerl/EncodingDetect.pm line 96, <$__ANONIO__> line 274.
Unable to recognise encoding of this document at C:/Perl/site/lib/XML/SAX/PurePerl/EncodingDetect.pm line 96, <$__ANONIO__> line 279.
Unable to recognise encoding of this document at C:/Perl/site/lib/XML/SAX/PurePerl/EncodingDetect.pm line 96, <$__ANONIO__> line 287.

Version 0.13 of XML::SAX introduced a rewrite of the pure Perl SAX parser. This parser has behaved awkwardly for a few people: I've noticed it when using PPM on machines with XML::SAX::Writer installed.

After a quick nose through the documentation for XML::SAX::ParserFactory, I installed XML::SAX::Expat through PPM. I then taught XML::SAX to use this parser instead of the whingeing XML::SAX::PurePerl parser by putting the following line in C:\Perl\site\lib\SAX.ini:

ParserPackage = XML::SAX::Expat

PPM now complained about a missing ParserDetails.ini, so I created an empty file at C:\Perl\site\lib\XML\SAX\ParserDetails.ini.

I feel a little guilty about avoiding the problem with a quick hack rather than creating an elegant solution. On the other hand, PPM doesn't spew errors out at me, so I laze around in the sun drinking. Errrr, I mean get on with other mission critical business tasks...


Similar problems on RedHat

Alias on 2006-06-10T07:18:42

I'm seeing similar problems install XML modules on RedHat due to the same errors.

Sample document?

Matts on 2006-06-10T14:13:14

If someone could send me a sample document I can get this fixed.

Re:Sample document?

tomhukins on 2006-06-12T15:24:08

I would do if I could figure out what causes this. I know it's something to do with PPM, so I ran the files PPM fetches through a simple SAX handler with XML::SAX::PurePerl but could not reproduce the error.