Hello community, here is the log from the commit of package perl-XML-SAX checked in at Fri Sep 12 18:13:37 CEST 2008. -------- --- perl-XML-SAX/perl-XML-SAX.changes 2007-12-14 16:22:56.000000000 +0100 +++ /mounts/work_src_done/STABLE/perl-XML-SAX/perl-XML-SAX.changes 2008-09-10 17:33:15.000000000 +0200 @@ -1,0 +2,15 @@ +Wed Sep 10 17:03:21 CEST 2008 - anicka@suse.cz + +- update to 0.96 + * Fix handling of numeric character entities in attribute + values + * Fix for numeric character entities spanning end of buffer + * Performance fix for parsing from large strings + * Fix for UTF8 bytes in first 4096 bytes of document not being + decoded to Perl-UTF8-characters + * incorrect operator precedence breaks single quotes around + DTD entity declarations + * Fix test in ParserFactory.pm for parser module loaded + * Fix XML::SAX::PurePerl versioning + +------------------------------------------------------------------- Old: ---- XML-SAX-0.16.tar.bz2 New: ---- XML-SAX-0.96.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-XML-SAX.spec ++++++ --- /var/tmp/diff_new_pack.o17747/_old 2008-09-12 18:13:32.000000000 +0200 +++ /var/tmp/diff_new_pack.o17747/_new 2008-09-12 18:13:32.000000000 +0200 @@ -1,18 +1,26 @@ # -# spec file for package perl-XML-SAX (Version 0.16) +# spec file for package perl-XML-SAX (Version 0.96) # -# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. -# This file and all modifications and additions to the pristine -# package are under the same license as the package itself. +# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild + Name: perl-XML-SAX BuildRequires: libxml2-devel perl-XML-NamespaceSupport -Version: 0.16 +Version: 0.96 Release: 1 Requires: perl = %{perl_version} Requires: perl-XML-NamespaceSupport @@ -64,7 +72,19 @@ /var/adm/perl-modules/%{name} %changelog -* Fri Dec 14 2007 - anicka@suse.cz +* Wed Sep 10 2008 anicka@suse.cz +- update to 0.96 + * Fix handling of numeric character entities in attribute + values + * Fix for numeric character entities spanning end of buffer + * Performance fix for parsing from large strings + * Fix for UTF8 bytes in first 4096 bytes of document not being + decoded to Perl-UTF8-characters + * incorrect operator precedence breaks single quotes around + DTD entity declarations + * Fix test in ParserFactory.pm for parser module loaded + * Fix XML::SAX::PurePerl versioning +* Fri Dec 14 2007 anicka@suse.cz - update to 0.16 * Applied patch for PI handling from RT#19173 * Fixed handling of entities in attribute values @@ -78,11 +98,11 @@ * Complete re-write of XML::SAX::PurePerl for performance * Support Encoding & XMLVersion in DocumentLocator interface * A few conformance tweaks to match perl SAX 2.1. -* Fri Jun 01 2007 - coolo@suse.de +* Fri Jun 01 2007 coolo@suse.de - remove libxml2-test from buildrequires -* Wed Jan 25 2006 - mls@suse.de +* Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires -* Mon Nov 15 2004 - ro@suse.de +* Mon Nov 15 2004 ro@suse.de - added perl-XML-NamespaceSupport to nfb and requires -* Thu Jul 29 2004 - ro@suse.de +* Thu Jul 29 2004 ro@suse.de - initial version 0.12 ++++++ XML-SAX-0.16.tar.bz2 -> XML-SAX-0.96.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/Changes new/XML-SAX-0.96/Changes --- old/XML-SAX-0.16/Changes 2007-06-27 11:08:06.000000000 +0200 +++ new/XML-SAX-0.96/Changes 2008-08-05 14:26:15.000000000 +0200 @@ -1,5 +1,25 @@ Revision history for Perl extension XML::SAX. +0.96 06 Aug 2008 Grant McLean + - Fix breakage of Unicode regexes on 5.6 (introduced in 0.95 release) + +0.95 05 Aug 2008 Grant McLean + - XML::SAX::PurePerl fixes: + - RT#37147: Fix handling of numeric character entities in attribute + values (report from Jools Smyth) + - RT#19442: Fix for numeric character entities spanning end of buffer + (report from Eivind Eklund) + - RT#29316: Performance fix for parsing from large strings (patch from + Gordon Lack) + - RT#26588: Fix for UTF8 bytes in first 4096 bytes of document not being + decoded to Perl-UTF8-characters (patch from Niko Tyni of the + Debian project) + - RT#37545: incorrect operator precedence breaks single quotes around + DTD entity declarations (report from Kevin Ryde) + - RT#28477: Fix test in ParserFactory.pm for parser module loaded (report + from Douglas Wilson) + - RT#28564: Fix XML::SAX::PurePerl versioning (report from Chapman Flack) + 0.16 27 Jun 2007 Grant McLean - Applied patch for PI handling from RT#19173 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/META.yml new/XML-SAX-0.96/META.yml --- old/XML-SAX-0.16/META.yml 2007-06-27 11:09:54.000000000 +0200 +++ new/XML-SAX-0.96/META.yml 2008-08-05 14:38:41.000000000 +0200 @@ -1,7 +1,7 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: XML-SAX -version: 0.16 +version: 0.96 version_from: SAX.pm installdirs: site requires: @@ -9,4 +9,4 @@ XML::NamespaceSupport: 0.03 distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.17 +generated_by: ExtUtils::MakeMaker version 6.30_01 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/DocumentLocator.pm new/XML-SAX-0.96/SAX/DocumentLocator.pm --- old/XML-SAX-0.16/SAX/DocumentLocator.pm 2005-10-14 22:31:20.000000000 +0200 +++ new/XML-SAX-0.96/SAX/DocumentLocator.pm 2005-10-14 22:31:20.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: DocumentLocator.pm,v 1.3 2005/10/14 20:31:20 matt Exp $ +# $Id: DocumentLocator.pm,v 1.3 2005-10-14 20:31:20 matt Exp $ package XML::SAX::DocumentLocator; use strict; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/Intro.pod new/XML-SAX-0.96/SAX/Intro.pod --- old/XML-SAX-0.16/SAX/Intro.pod 2002-04-30 09:16:00.000000000 +0200 +++ new/XML-SAX-0.96/SAX/Intro.pod 2008-08-04 12:28:01.000000000 +0200 @@ -348,7 +348,7 @@ his article on XML.com here <URI>. To construct SAX pipelines, Barrie Slaymaker, a long time Perl hacker -who's modules you will probably have heard of or used, wrote a very +whose modules you will probably have heard of or used, wrote a very clever module called XML::SAX::Machines. This combines some really clever SAX filter-type modules, with a construction toolkit for filters that makes building pipelines easy. But before we see how it makes @@ -402,6 +402,6 @@ Matt Sergeant, matt@sergeant.org -$Id: Intro.pod,v 1.3 2002/04/30 07:16:00 matt Exp $ +$Id: Intro.pod,v 1.4 2008-08-04 10:28:01 grant Exp $ =cut diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/ParserFactory.pm new/XML-SAX-0.96/SAX/ParserFactory.pm --- old/XML-SAX-0.16/SAX/ParserFactory.pm 2002-11-19 19:25:47.000000000 +0100 +++ new/XML-SAX-0.96/SAX/ParserFactory.pm 2008-08-04 06:51:29.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: ParserFactory.pm,v 1.13 2002/11/19 18:25:47 matt Exp $ +# $Id: ParserFactory.pm,v 1.14 2008-08-04 04:51:29 grant Exp $ package XML::SAX::ParserFactory; @@ -33,11 +33,9 @@ $version = " $1"; } - { - no strict 'refs'; - if (!keys %{"${parser_class}::"}) { - eval "use $parser_class $version;"; - } + if (!$parser_class->can('new')) { + eval "require $parser_class $version;"; + die $@ if $@; } return $parser_class->new(@parser_params); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/DebugHandler.pm new/XML-SAX-0.96/SAX/PurePerl/DebugHandler.pm --- old/XML-SAX-0.16/SAX/PurePerl/DebugHandler.pm 2001-11-24 18:47:53.000000000 +0100 +++ new/XML-SAX-0.96/SAX/PurePerl/DebugHandler.pm 2001-11-24 18:47:53.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: DebugHandler.pm,v 1.3 2001/11/24 17:47:53 matt Exp $ +# $Id: DebugHandler.pm,v 1.3 2001-11-24 17:47:53 matt Exp $ package XML::SAX::PurePerl::DebugHandler; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/DocType.pm new/XML-SAX-0.96/SAX/PurePerl/DocType.pm --- old/XML-SAX-0.16/SAX/PurePerl/DocType.pm 2003-07-30 15:39:22.000000000 +0200 +++ new/XML-SAX-0.96/SAX/PurePerl/DocType.pm 2003-07-30 15:39:22.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: DocType.pm,v 1.3 2003/07/30 13:39:22 matt Exp $ +# $Id: DocType.pm,v 1.3 2003-07-30 13:39:22 matt Exp $ package XML::SAX::PurePerl; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/DTDDecls.pm new/XML-SAX-0.96/SAX/PurePerl/DTDDecls.pm --- old/XML-SAX-0.16/SAX/PurePerl/DTDDecls.pm 2005-10-14 22:31:20.000000000 +0200 +++ new/XML-SAX-0.96/SAX/PurePerl/DTDDecls.pm 2008-08-05 14:37:13.000000000 +0200 @@ -1,9 +1,9 @@ -# $Id: DTDDecls.pm,v 1.7 2005/10/14 20:31:20 matt Exp $ +# $Id: DTDDecls.pm,v 1.9 2008-08-05 12:37:13 grant Exp $ package XML::SAX::PurePerl; use strict; -use XML::SAX::PurePerl::Productions qw($NameChar $SingleChar); +use XML::SAX::PurePerl::Productions qw($SingleChar); sub elementdecl { my ($self, $reader) = @_; @@ -469,7 +469,7 @@ my $data = $reader->data; my $quote = '"'; my $re = $quotre; - if (!$data =~ /^"/) { + if ($data !~ /^"/) { $data =~ /^'/ or $self->parser_error("Not a quote character", $reader); $quote = "'"; $re = $aposre; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/EncodingDetect.pm new/XML-SAX-0.96/SAX/PurePerl/EncodingDetect.pm --- old/XML-SAX-0.16/SAX/PurePerl/EncodingDetect.pm 2007-02-07 10:33:50.000000000 +0100 +++ new/XML-SAX-0.96/SAX/PurePerl/EncodingDetect.pm 2007-02-07 10:33:50.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: EncodingDetect.pm,v 1.6 2007/02/07 09:33:50 grant Exp $ +# $Id: EncodingDetect.pm,v 1.6 2007-02-07 09:33:50 grant Exp $ package XML::SAX::PurePerl; # NB, not ::EncodingDetect! diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/Exception.pm new/XML-SAX-0.96/SAX/PurePerl/Exception.pm --- old/XML-SAX-0.16/SAX/PurePerl/Exception.pm 2001-11-14 12:07:25.000000000 +0100 +++ new/XML-SAX-0.96/SAX/PurePerl/Exception.pm 2001-11-14 12:07:25.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: Exception.pm,v 1.2 2001/11/14 11:07:25 matt Exp $ +# $Id: Exception.pm,v 1.2 2001-11-14 11:07:25 matt Exp $ package XML::SAX::PurePerl::Exception; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/NoUnicodeExt.pm new/XML-SAX-0.96/SAX/PurePerl/NoUnicodeExt.pm --- old/XML-SAX-0.16/SAX/PurePerl/NoUnicodeExt.pm 2002-01-30 18:35:21.000000000 +0100 +++ new/XML-SAX-0.96/SAX/PurePerl/NoUnicodeExt.pm 2002-01-30 18:35:21.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: NoUnicodeExt.pm,v 1.1 2002/01/30 17:35:21 matt Exp $ +# $Id: NoUnicodeExt.pm,v 1.1 2002-01-30 17:35:21 matt Exp $ package XML::SAX::PurePerl; use strict; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/Productions.pm new/XML-SAX-0.96/SAX/PurePerl/Productions.pm --- old/XML-SAX-0.16/SAX/PurePerl/Productions.pm 2003-07-30 15:39:22.000000000 +0200 +++ new/XML-SAX-0.96/SAX/PurePerl/Productions.pm 2008-08-05 14:37:13.000000000 +0200 @@ -1,10 +1,10 @@ -# $Id: Productions.pm,v 1.11 2003/07/30 13:39:22 matt Exp $ +# $Id: Productions.pm,v 1.13 2008-08-05 12:37:13 grant Exp $ package XML::SAX::PurePerl::Productions; use Exporter; @ISA = ('Exporter'); -@EXPORT_OK = qw($S $Char $VersionNum $BaseChar $Letter $Ideographic +@EXPORT_OK = qw($S $Char $VersionNum $BaseChar $Ideographic $Extender $Digit $CombiningChar $EncNameStart $EncNameEnd $NameChar $CharMinusDash $PubidChar $Any $SingleChar); @@ -36,12 +36,10 @@ $Digit = qr/ [\x30-\x39] /x; - $Letter = qr/^ $BaseChar $/x; - # can't do this one without unicode # $CombiningChar = qr/^$/msx; - $NameChar = qr/^ $BaseChar | $Digit | [._:-] | $Extender $/x; + $NameChar = qr/^ (?: $BaseChar | $Digit | [._:-] | $Extender )+ $/x; PERL die $@ if $@; } @@ -138,9 +136,7 @@ [\x{4E00}-\x{9FA5}\x{3007}\x{3021}-\x{3029}] /x; - $Letter = qr/^ $BaseChar | $Ideographic $/x; - - $NameChar = qr/^ $Letter | $Digit | [._:-] | $CombiningChar | $Extender $/x; + $NameChar = qr/^ (?: $BaseChar | $Ideographic | $Digit | [._:-] | $CombiningChar | $Extender )+ $/x; PERL die $@ if $@; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/Reader/NoUnicodeExt.pm new/XML-SAX-0.96/SAX/PurePerl/Reader/NoUnicodeExt.pm --- old/XML-SAX-0.16/SAX/PurePerl/Reader/NoUnicodeExt.pm 2003-07-30 15:39:23.000000000 +0200 +++ new/XML-SAX-0.96/SAX/PurePerl/Reader/NoUnicodeExt.pm 2003-07-30 15:39:23.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: NoUnicodeExt.pm,v 1.3 2003/07/30 13:39:23 matt Exp $ +# $Id: NoUnicodeExt.pm,v 1.3 2003-07-30 13:39:23 matt Exp $ package XML::SAX::PurePerl::Reader; use strict; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/Reader/Stream.pm new/XML-SAX-0.96/SAX/PurePerl/Reader/Stream.pm --- old/XML-SAX-0.16/SAX/PurePerl/Reader/Stream.pm 2005-10-14 22:31:20.000000000 +0200 +++ new/XML-SAX-0.96/SAX/PurePerl/Reader/Stream.pm 2008-08-04 04:14:30.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: Stream.pm,v 1.7 2005/10/14 20:31:20 matt Exp $ +# $Id: Stream.pm,v 1.7 2005-10-14 20:31:20 matt Exp $ package XML::SAX::PurePerl::Reader::Stream; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/Reader/String.pm new/XML-SAX-0.96/SAX/PurePerl/Reader/String.pm --- old/XML-SAX-0.16/SAX/PurePerl/Reader/String.pm 2003-07-30 15:39:23.000000000 +0200 +++ new/XML-SAX-0.96/SAX/PurePerl/Reader/String.pm 2008-08-04 05:35:44.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: String.pm,v 1.5 2003/07/30 13:39:23 matt Exp $ +# $Id: String.pm,v 1.6 2008-08-04 03:35:44 grant Exp $ package XML::SAX::PurePerl::Reader::String; @@ -15,23 +15,40 @@ @ISA = ('XML::SAX::PurePerl::Reader'); -use constant DISCARDED => 7; +use constant DISCARDED => 8; +use constant STRING => 9; +use constant USED => 10; +use constant CHUNK_SIZE => 2048; sub new { my $class = shift; my $string = shift; my @parts; - @parts[BUFFER, EOF, LINE, COLUMN, DISCARDED] = - ($string, 0, 1, 0, ''); + @parts[BUFFER, EOF, LINE, COLUMN, DISCARDED, STRING, USED] = + ('', 0, 1, 0, 0, $string, 0); return bless \@parts, $class; } -sub read_more () { } +sub read_more () { + my $self = shift; + if ($self->[USED] >= length($self->[STRING])) { + $self->[EOF]++; + return 0; + } + my $bytes = CHUNK_SIZE; + if ($bytes > (length($self->[STRING]) - $self->[USED])) { + $bytes = (length($self->[STRING]) - $self->[USED]); + } + $self->[BUFFER] .= substr($self->[STRING], $self->[USED], $bytes); + $self->[USED] += $bytes; + return 1; + } + sub move_along { - my $self = shift; - my $discarded = substr($self->[BUFFER], 0, $_[0], ''); - $self->[DISCARDED] .= $discarded; + my($self, $bytes) = @_; + my $discarded = substr($self->[BUFFER], 0, $bytes, ''); + $self->[DISCARDED] += length($discarded); # Wish I could skip this lot - tells us where we are in the file my $lines = $discarded =~ tr/\n//; @@ -55,7 +72,7 @@ sub bytepos { my $self = shift; - length($self->[DISCARDED]); + $self->[DISCARDED]; } 1; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/Reader/UnicodeExt.pm new/XML-SAX-0.96/SAX/PurePerl/Reader/UnicodeExt.pm --- old/XML-SAX-0.16/SAX/PurePerl/Reader/UnicodeExt.pm 2003-07-30 15:39:23.000000000 +0200 +++ new/XML-SAX-0.96/SAX/PurePerl/Reader/UnicodeExt.pm 2008-08-04 12:04:54.000000000 +0200 @@ -1,9 +1,9 @@ -# $Id: UnicodeExt.pm,v 1.4 2003/07/30 13:39:23 matt Exp $ +# $Id: UnicodeExt.pm,v 1.5 2008-08-04 10:04:54 grant Exp $ package XML::SAX::PurePerl::Reader; use strict; -use Encode; +use Encode (); sub set_raw_stream { my ($fh) = @_; @@ -16,7 +16,7 @@ } sub switch_encoding_string { - Encode::from_to($_[0], $_[1], "utf-8"); + $_[0] = Encode::decode($_[1], $_[0]); } 1; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/Reader/URI.pm new/XML-SAX-0.96/SAX/PurePerl/Reader/URI.pm --- old/XML-SAX-0.16/SAX/PurePerl/Reader/URI.pm 2001-11-11 19:41:51.000000000 +0100 +++ new/XML-SAX-0.96/SAX/PurePerl/Reader/URI.pm 2001-11-11 19:41:51.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: URI.pm,v 1.1 2001/11/11 18:41:51 matt Exp $ +# $Id: URI.pm,v 1.1 2001-11-11 18:41:51 matt Exp $ package XML::SAX::PurePerl::Reader::URI; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/Reader.pm new/XML-SAX-0.96/SAX/PurePerl/Reader.pm --- old/XML-SAX-0.16/SAX/PurePerl/Reader.pm 2005-10-14 22:31:20.000000000 +0200 +++ new/XML-SAX-0.96/SAX/PurePerl/Reader.pm 2008-08-05 14:37:13.000000000 +0200 @@ -1,10 +1,9 @@ -# $Id: Reader.pm,v 1.11 2005/10/14 20:31:20 matt Exp $ +# $Id: Reader.pm,v 1.13 2008-08-05 12:37:13 grant Exp $ package XML::SAX::PurePerl::Reader; use strict; use XML::SAX::PurePerl::Reader::URI; -use XML::SAX::PurePerl::Productions qw( $SingleChar $Letter $NameChar ); use Exporter (); use vars qw(@ISA @EXPORT_OK); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/UnicodeExt.pm new/XML-SAX-0.96/SAX/PurePerl/UnicodeExt.pm --- old/XML-SAX-0.16/SAX/PurePerl/UnicodeExt.pm 2002-01-30 18:35:21.000000000 +0100 +++ new/XML-SAX-0.96/SAX/PurePerl/UnicodeExt.pm 2002-01-30 18:35:21.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: UnicodeExt.pm,v 1.1 2002/01/30 17:35:21 matt Exp $ +# $Id: UnicodeExt.pm,v 1.1 2002-01-30 17:35:21 matt Exp $ package XML::SAX::PurePerl; use strict; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl/XMLDecl.pm new/XML-SAX-0.96/SAX/PurePerl/XMLDecl.pm --- old/XML-SAX-0.16/SAX/PurePerl/XMLDecl.pm 2003-07-30 15:39:22.000000000 +0200 +++ new/XML-SAX-0.96/SAX/PurePerl/XMLDecl.pm 2003-07-30 15:39:22.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: XMLDecl.pm,v 1.3 2003/07/30 13:39:22 matt Exp $ +# $Id: XMLDecl.pm,v 1.3 2003-07-30 13:39:22 matt Exp $ package XML::SAX::PurePerl; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX/PurePerl.pm new/XML-SAX-0.96/SAX/PurePerl.pm --- old/XML-SAX-0.16/SAX/PurePerl.pm 2007-06-27 11:08:00.000000000 +0200 +++ new/XML-SAX-0.96/SAX/PurePerl.pm 2008-08-05 14:36:51.000000000 +0200 @@ -1,13 +1,13 @@ -# $Id: PurePerl.pm,v 1.23 2007/06/27 09:08:00 grant Exp $ +# $Id: PurePerl.pm,v 1.28 2008-08-05 12:36:51 grant Exp $ package XML::SAX::PurePerl; use strict; use vars qw/$VERSION/; -$VERSION = '0.92'; +$VERSION = '0.96'; -use XML::SAX::PurePerl::Productions qw($Any $CharMinusDash $SingleChar); +use XML::SAX::PurePerl::Productions qw($NameChar $SingleChar); use XML::SAX::PurePerl::Reader; use XML::SAX::PurePerl::EncodingDetect (); use XML::SAX::Exception; @@ -374,6 +374,11 @@ return 0 unless $reader->match('&'); my $data = $reader->data; + + # Fetch more data if we have an incomplete numeric reference + if ($data =~ /^(#\d*|#x[0-9a-fA-F]*)$/) { + $data = $reader->data(length($data) + 6); + } if ($data =~ /^#x([0-9a-fA-F]+);/) { my $ref = $1; @@ -580,7 +585,7 @@ } $value =~ s/[\x09\x0A\x0D]/\x20/g; - $value =~ s/&(#(x[0-9a-fA-F]+)|([0-9]+)|\w+);/$self->AttReference($1, $reader)/geo; + $value =~ s/&(#(x[0-9a-fA-F]+)|#([0-9]+)|\w+);/$self->AttReference($1, $reader)/geo; return $value; } @@ -663,7 +668,7 @@ while(1) { my $data = $reader->data; return unless length($data); - $data =~ /^([^\s>\/&\?;=<\)\(\[\],\%\#\!\*]*)/ or return; + $data =~ /^([^\s>\/&\?;=<\)\(\[\],\%\#\!\*\|]*)/ or return; $name .= $1; my $len = length($1); $reader->move_along($len); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/SAX.pm new/XML-SAX-0.96/SAX.pm --- old/XML-SAX-0.16/SAX.pm 2007-06-27 11:09:12.000000000 +0200 +++ new/XML-SAX-0.96/SAX.pm 2008-08-05 14:36:24.000000000 +0200 @@ -1,11 +1,11 @@ -# $Id: SAX.pm,v 1.29 2007/06/27 09:09:12 grant Exp $ +# $Id: SAX.pm,v 1.31 2008-08-05 12:36:24 grant Exp $ package XML::SAX; use strict; use vars qw($VERSION @ISA @EXPORT_OK); -$VERSION = '0.16'; +$VERSION = '0.96'; use Exporter (); @ISA = ('Exporter'); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/t/00basic.t new/XML-SAX-0.96/t/00basic.t --- old/XML-SAX-0.16/t/00basic.t 2001-11-19 15:31:39.000000000 +0100 +++ new/XML-SAX-0.96/t/00basic.t 2008-08-04 22:22:12.000000000 +0200 @@ -1,6 +1,11 @@ use Test; -BEGIN { plan tests => 1 } -END { ok($loaded) } +BEGIN { plan tests => 2 } +END { ok($loaded == 2) } use XML::SAX; $loaded++; +use XML::SAX::PurePerl; +$loaded++; + +ok(XML::SAX->VERSION eq XML::SAX::PurePerl->VERSION); + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/t/14encoding.t new/XML-SAX-0.96/t/14encoding.t --- old/XML-SAX-0.16/t/14encoding.t 2001-11-19 15:32:09.000000000 +0100 +++ new/XML-SAX-0.96/t/14encoding.t 2008-08-04 11:26:40.000000000 +0200 @@ -1,23 +1,25 @@ use Test; BEGIN { $tests = 0; - if ($] >= 5.007002) { $tests = 7 } + if ($] >= 5.007002) { $tests = 9 } plan tests => $tests; } if ($tests) { use XML::SAX::PurePerl; -use XML::SAX::PurePerl::DebugHandler; -my $handler = XML::SAX::PurePerl::DebugHandler->new(); +my $handler = TestHandler->new(); # see below for the TestHandler class ok($handler); my $parser = XML::SAX::PurePerl->new(Handler => $handler); ok($parser); # warn("utf-16\n"); +# verify that the first element is correctly decoded +$handler->{test_elements} = [ "\x{9031}\x{5831}" ]; $parser->parse_uri("testfiles/utf-16.xml"); ok(1); # warn("utf-16le\n"); +$handler->{test_elements} = [ "foo" ]; $parser->parse_uri("testfiles/utf-16le.xml"); ok(1); @@ -33,3 +35,19 @@ $parser->parse_uri("testfiles/iso8859_2.xml"); ok(1); } + +package TestHandler; +use XML::SAX::PurePerl::DebugHandler; +use base qw(XML::SAX::PurePerl::DebugHandler); +use Test; + +sub start_element { + my $self = shift; + if ($self->{test_elements} and + my $value = pop @{$self->{test_elements}}) { + ok($_[0]->{Name}, $value); + } + $self->SUPER::start_element(@_); +} + +1; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/t/42entities.t new/XML-SAX-0.96/t/42entities.t --- old/XML-SAX-0.16/t/42entities.t 2007-02-07 10:24:39.000000000 +0100 +++ new/XML-SAX-0.96/t/42entities.t 2008-08-04 02:32:42.000000000 +0200 @@ -12,10 +12,10 @@ my $parser = XML::SAX::PurePerl->new(Handler => $handler); ok($parser); -$parser->parse_string('<code amp="&" x3E=">" />'); +$parser->parse_string('<code amp="&" x3E=">" num="A" />'); ok(1); # parser didn't die -my $expected = "amp=& x3E=> "; +my $expected = "amp=& num=A x3E=> "; ok($handler->attributes, $expected); exit; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/XML-SAX-0.16/XML-SAX-Base/Makefile.PL new/XML-SAX-0.96/XML-SAX-Base/Makefile.PL --- old/XML-SAX-0.16/XML-SAX-Base/Makefile.PL 2007-02-07 10:33:50.000000000 +0100 +++ new/XML-SAX-0.96/XML-SAX-Base/Makefile.PL 2007-02-07 10:33:50.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: Makefile.PL,v 1.15 2007/02/07 09:33:50 grant Exp $ +# $Id: Makefile.PL,v 1.15 2007-02-07 09:33:50 grant Exp $ use strict; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org