ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
Re: problem adding new encoding to perl XML::Parser
by Robin Berjon other posts by this author
Sep 4 2002 10:33PM messages near this date
view in the new Beta List Site
Re: problem adding new encoding to perl XML::Parser | RE: Still can't make XML::Parser
On Wednesday 04 September 2002 09:20, Duncan Cameron wrote:
>  You're misunderstanding XML::Encoding.  It *is* a subclass of
>  XML::Parser but its purpose is simply to parse encoding map files
>  in order to create new binary encodings for XML::Parser.

Ooops, sorry, I shouldn't try to help from memory for stuff that I haven't 
used in ages. Having read the XML::Parser docs, I think the following is what 
points to the problem:

"For encodings other than the built-ins, expat calls the function 
load_encoding in the Expat package with the encoding name. This function 
looks for a file in the path list @XML::Parser::Expat::Encoding_Path, that 
matches the lower-cased name with a '.enc' extension. The first one it finds, 
it loads."

So a dump of that array might reveal something. Also, the poster mentions:

> > 6. copy GB2312.enc to
> >    /usr/lib/perl5/site_perl/5.005/i386-linux/XML/Parser/Encodings

and the docs talk about a lower-cased version of that file, which would be 
gb2312.enc.

>  The poster clearly wanted to parse documents with GB2313 encoding
>  which XML::Parser should be able to do. Can we recommend other XML
>  parsers (SAX or not) which support that encoding?  The SAX2 comment
>  doesn't seem directly relevant to his problem.

It's not directly related but it was meant to be helpful nevertheless. 
XML::Parser isn't really actively supported and all development efforts 
concentrate on SAX2 parsers. Also, some of those are built around parsers 
that will more likely support more encodings, or support the ones installed 
on the system (eg the iconv ones). Trying XML::LibXML's SAX parser (for 
instance) could help.

-- 
Robin Berjon <robin@[...].com> 
  I don't suffer from insanity. I enjoy every minute of it.
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Duncan Cameron
Robin Berjon

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved