OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] problem adding new encoding to perl XML::Parser

[ Lists Home | Date Index | Thread Index ]

Daben Liu wrote:
> The XML::Parser installed from CPAN does not come with a 
> GB2312 encoding support. However, I was not able to add 
> the support as instructed by the XML::Encoding package.
> 
> Then I made the following perl script:
> ---------------
> #!/usr/bin/perl
> use XML::Parser;
> 
> my $xmlfile = $ARGV[0];
> my $parser = new XML::Parser();
> my $doc = $parser->parsefile ("$xmlfile");
> ---------------

This is where your error is. As explained in the XML::Encoding 
documentation, XML::Encoding is a *subclass* of XML::Parser. In order to 
use it, you need to replace all occurences of XML::Parser in your script 
with XML::Encoding.

The perl-xml list from ActiveState may be a better source of information 
on the topic.

As a side-note, XML::Parser is pretty much considered to be deprecated 
by the Perl XML community. Nowadays people tend to take their pick from 
one of the many SAX2 parsers that are on CPAN.

-- 
Robin Berjon <robin.berjon@expway.fr>
Research Engineer, Expway
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS