Re: Continuing Perl 5.8.0 Problems
by Steve Hay other posts by this author
Oct 2 2002 2:33PM messages near this date
view in the new Beta List Site
Re: Continuing Perl 5.8.0 Problems
|
Re: Continuing Perl 5.8.0 Problems
Robin Berjon wrote:
> Steve Hay wrote:
>
> > Continuing my investigations into the problems that I've previously
> > reported concerning XML::Parser/XML::DOM under Perl 5.8.0, I've now
> > produced a very short Perl script that uses neitehr module but
> > reproduces the error reported by XML::DOM's XmlUtf8Decode() function.
>
> >
>
> > So to reproduce the XML::DOM module's problem we must set the UTF-8
> > flag on our $str as well. Inserting the following two lines:
> >
> > require Encode;
> > Encode::_utf8_on($str);
>
>
> Just a stab in the dark: does it make a difference if instead of
> _utf8_on() you use one of the more "official" Encode functions?
> _utf8_on() is documented, but it is also flagged as "internal" so
> maybe one of the other functions does something different that's needed?
There don't appear to be any "official" functions to turn off the UTF-8
flag. The other functions in the Encode module are for converting data
to/from different encodings; the data in question here is already
encoded in UTF-8 -- I'm only fiddling with whether or not it is
"flagged" as such.
Leaving the data "unflagged" in the short test program that I sent
earlier "fixes" that program. So another option would be to turn off
the flag for the data in the XML::DOM module. If I insert:
require Encode;
Encode::_utf8_off($str)
into the head of XML::DOM's encodeText() method, then I do indeed get
different results - slightly fewer test failures and no errors coming
from XmlUtf8Decode(). However, I've got no idea whether doing this
breaks things for other users, and it still doesn't completely fix it
for me anyway.
> > exactly like the errors reported by XML::DOM's test suite.
>
>
> Unrelated question: do you need to use XML::DOM? Last time I checked
> it was only DOM Level 1 compatible, and that's almost deprecated.
> Would a pure Perl W3C DOM L2 implementation interest anyone? I have
> one which I never released because I thought I'd be the only one to
> use it, but if there's interest I can put it on CPAN.
It is indeed only DOM Level 1. I understand that XML::GDOME is DOM
Level 2, and is based around a DOM Level 2 'C' library so is in theory
loads quicker too. However, I've been unable to build it on Win32/MSVC6
- it's very Linux-oriented.
Either a Pure Perl DOM L2 implementation, or some help building
XML::GDOME on Win32, would be of interest, although that would still
leave me with the task of re-writing loads of my software that's
currently using XML::DOM :-(
- Steve
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Steve Hay
Steve Hay
Robin Berjon
Steve Hay
Petr Pajas
Robin Berjon
Steve Hay
Petr Pajas
|