r3588 - in /packages/libxml-writer-perl/branches/upstream/current: Changes META.yml Makefile.PL Writer.pm t/01_main.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Sat Sep 2 18:03:15 UTC 2006


Author: gregoa-guest
Date: Sat Sep  2 18:03:15 2006
New Revision: 3588

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=3588
Log:
Load /tmp/tmp.Jivwt29407/libxml-writer-perl-0.601 into
packages/libxml-writer-perl/branches/upstream/current.

Modified:
    packages/libxml-writer-perl/branches/upstream/current/Changes
    packages/libxml-writer-perl/branches/upstream/current/META.yml
    packages/libxml-writer-perl/branches/upstream/current/Makefile.PL
    packages/libxml-writer-perl/branches/upstream/current/Writer.pm
    packages/libxml-writer-perl/branches/upstream/current/t/01_main.t

Modified: packages/libxml-writer-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libxml-writer-perl/branches/upstream/current/Changes?rev=3588&op=diff
==============================================================================
--- packages/libxml-writer-perl/branches/upstream/current/Changes (original)
+++ packages/libxml-writer-perl/branches/upstream/current/Changes Sat Sep  2 18:03:15 2006
@@ -1,53 +1,63 @@
 Revision history for Perl extension XML::Writer.
 
+0.601 Fri Sep  1 15:01:45 BST 2006    <joe at kafsemo.org>
+        - Don't modify list references passed as tag or attribute names
+           (cpan #14854).
+
+0.600 Thu Jun 30 23:17:00 BST 2005    <joe at kafsemo.org>
+        - Don't include an encoding in the XML declaration unless one
+           is specified.
+        - Check for, and croak on, invalid characters (including ASCII NUL).
+        - Fixed 'ancestor' with out-of-bounds indexes.
+
 0.545 Mon May 16 08:11:17 BST 2005    <joe at kafsemo.org>
-	- Format comments like elements when in data mode.
-	- Only attempt Unicode tests for Perl >= 5.8.1.
+        - Format comments like elements when in data mode.
+        - Only attempt Unicode tests for Perl >= 5.8.1.
 
 0.540 Tue May 10 18:18:58 BST 2005    <joe at kafsemo.org>
-	- Don't die when ENCODING is specified with a scalar OUTPUT.
-	- Add support for US-ASCII encoding.
+        - Don't die when ENCODING is specified with a scalar OUTPUT.
+        - Add support for US-ASCII encoding.
 
 0.531 Mon Mar 14 22:11:33 GMT 2005    <joe at kafsemo.org>
-	- Rename internal String package to avoid clash with external modules.
-	- Fix Unicode test skipping for Perls before 5.8.
+        - Rename internal String package to avoid clash with external modules.
+        - Fix Unicode test skipping for Perls before 5.8.
 
 0.530 Tue Feb  1 13:09:31 GMT 2005    <joe at kafsemo.org>
-	- Allow scalar references for the OUTPUT parameter, inspired by
-	   Simon Oliver's XML::Writer::String (patch from Yanick Champoux)
-	- Added ENCODING parameter; currently only UTF-8 is supported
-	- Escape newlines in attribute values
+        - Allow scalar references for the OUTPUT parameter, inspired by
+           Simon Oliver's XML::Writer::String (patch from Yanick Champoux)
+        - Added ENCODING parameter; currently only UTF-8 is supported
+        - Escape newlines in attribute values
 
 0.520 Wed Sep  1 16:18:46 BST 2004    <joe at kafsemo.org>
-	- Fixed bug with forced declaration of the default namespace (#7266)
-	- Removed dead code. Added copyright notices to pod.
-	- Improved test coverage
+        - Fixed bug with forced declaration of the default namespace (#7266)
+        - Removed dead code. Added copyright notices to pod.
+        - Improved test coverage
 
 0.510 Tue May 25 19:46:04 BST 2004    <joe at kafsemo.org>
-	- Permitted in-document namespace prefix control
-	- Don't reopen STDOUT for output (closes #6232)
-	- Moved tests into t/. Added tests for mid-document namespace changes.
-	  Show diffs when comparison tests fail
+        - Permitted in-document namespace prefix control
+        - Don't reopen STDOUT for output (closes #6232)
+        - Moved tests into t/. Added tests for mid-document namespace changes.
+          Show diffs when comparison tests fail
 
 0.500 Sat Mar  6 22:45:54 GMT 2004    <joe at kafsemo.org>
-	- Prepared metadata for a consistent, CPAN-friendly 0.500 release
-	- Added a META.yml to prevent XML::Writer::Namespaces from
-	  being indexed
-	- Writer.pm: Removed a duplicate check for valid attribute names
-	- test.pl: Added more tests for full coverage of the cdata method
+        - Prepared metadata for a consistent, CPAN-friendly 0.500 release
+        - Added a META.yml to prevent XML::Writer::Namespaces from
+          being indexed
+        - Writer.pm: Removed a duplicate check for valid attribute names
+        - test.pl: Added more tests for full coverage of the cdata method
 
 0.4.6 Tue Mar  2 16:54:04 GMT 2004    <joe at kafsemo.org>
-	- test.pl: Revert to using a temporary file, rather than an
-	  IO::String, for compatibility with older Perls
+        - test.pl: Revert to using a temporary file, rather than an
+          IO::String, for compatibility with older Perls
 
 0.4.5 Mon Mar  1 14:46:47 GMT 2004    <joe at kafsemo.org>
-	- added FORCED_NS_DECLS parameter, to declare namespaces ahead of use
-	- fixed check for duplicate attributes
-	- correctly take the default namespace from the supplied prefix map
-	- no longer produce namespace declarations for the 'xml:' prefix
-	- allow xml-stylesheet PIs
-	- fixed warnings about uninitialised values
-	- added a comprehensive suite of tests, using Test::More
+        - added FORCED_NS_DECLS parameter, to declare namespaces ahead of use
+        - fixed check for duplicate attributes
+        - correctly take the default namespace from the supplied prefix map
+        - no longer produce namespace declarations for the 'xml:' prefix
+        - allow xml-stylesheet PIs
+        - fixed warnings about uninitialised values
+        - added a comprehensive suite of tests, using Test::More
 
 0.4.2 Sun Feb 22 15:33:44 GMT 2004    ed at membled.com
         - added raw() to print raw, unescaped text
@@ -58,25 +68,25 @@
         - fixed deprecation warning from 'use IO'
 
 0.4 Tue Apr  4 21:59:51 EDT 2000
-	- added support for a simple data mode (off by default), with
-	  no mixed content and automatic whitespace and indenting
-	- added get/setDataMode and get/setDataIndent methods
-	- added DATA_MODE and DATA_INDENT parameters to constructor
-	- added dataElement method for simple case (character data
-	  content only)
+        - added support for a simple data mode (off by default), with
+          no mixed content and automatic whitespace and indenting
+        - added get/setDataMode and get/setDataIndent methods
+        - added DATA_MODE and DATA_INDENT parameters to constructor
+        - added dataElement method for simple case (character data
+          content only)
 
 0.3 Thu Dec  9 12:49:28 EST 1999
-	- fixed frequently-reported attribute-list bug
-	- changed xmlDecl() so that first argument is the encoding
-	- added 'use IO;' to avoid errors
-	- documented the doctype() method
+        - fixed frequently-reported attribute-list bug
+        - changed xmlDecl() so that first argument is the encoding
+        - added 'use IO;' to avoid errors
+        - documented the doctype() method
 
 0.2
-	- added Namespace support (XML::Writer::Namespaces subclass
-	  and NAMESPACES constructor parameter)
-	- added PREFIX_MAP constructor parameter, and
-	  add/removePrefix() methods for Namespace support
-	- added getOutput() and setOutput() methods
+        - added Namespace support (XML::Writer::Namespaces subclass
+          and NAMESPACES constructor parameter)
+        - added PREFIX_MAP constructor parameter, and
+          add/removePrefix() methods for Namespace support
+        - added getOutput() and setOutput() methods
         - added new query methods in_element(), within_element(),
           current_element(), and ancestor()
         - changed constructor to use parameterized arguments

Modified: packages/libxml-writer-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libxml-writer-perl/branches/upstream/current/META.yml?rev=3588&op=diff
==============================================================================
--- packages/libxml-writer-perl/branches/upstream/current/META.yml (original)
+++ packages/libxml-writer-perl/branches/upstream/current/META.yml Sat Sep  2 18:03:15 2006
@@ -2,7 +2,7 @@
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 meta-spec:    1.1
 name:         XML-Writer
-version:      0.600
+version:      0.601
 abstract:     Easily generate well-formed, namespace-aware XML.
 authored_by:
   - David Megginson <david at megginson.com>

Modified: packages/libxml-writer-perl/branches/upstream/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libxml-writer-perl/branches/upstream/current/Makefile.PL?rev=3588&op=diff
==============================================================================
--- packages/libxml-writer-perl/branches/upstream/current/Makefile.PL (original)
+++ packages/libxml-writer-perl/branches/upstream/current/Makefile.PL Sat Sep  2 18:03:15 2006
@@ -7,7 +7,7 @@
 # the contents of the Makefile that is written.
 WriteMakefile(
     'NAME'    => 'XML::Writer',
-    'VERSION' => '0.600',
+    'VERSION' => '0.601',
 
     # A manually-created META.yml has all the other metadata;
     #  we don't want it overwritten

Modified: packages/libxml-writer-perl/branches/upstream/current/Writer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libxml-writer-perl/branches/upstream/current/Writer.pm?rev=3588&op=diff
==============================================================================
--- packages/libxml-writer-perl/branches/upstream/current/Writer.pm (original)
+++ packages/libxml-writer-perl/branches/upstream/current/Writer.pm Sat Sep  2 18:03:15 2006
@@ -4,7 +4,7 @@
 # Copyright (c) 2004, 2005 by Joseph Walton <joe at kafsemo.org>.
 # No warranty.  Commercial and non-commercial use freely permitted.
 #
-# $Id: Writer.pm,v 1.48 2005/06/30 22:17:04 josephw Exp $
+# $Id: Writer.pm 166 2006-09-01 14:17:24Z josephw $
 ########################################################################
 
 package XML::Writer;
@@ -15,7 +15,7 @@
 use vars qw($VERSION);
 use Carp;
 use IO::Handle;
-$VERSION = "0.600";
+$VERSION = "0.601";
 
 
 
@@ -921,12 +921,16 @@
   #
   my $nsProcess = sub {
     if (ref($_[0]->[0]) eq 'ARRAY') {
-      &{$processName}(\$_[0]->[0], $_[0], 0);
+      my $x = \@{$_[0]->[0]};
+      &{$processName}(\$x, $_[0], 0);
+      splice(@{$_[0]}, 0, 1, $x);
     }
     my $i = 1;
     while ($_[0]->[$i]) {
       if (ref($_[0]->[$i]) eq 'ARRAY') {
-        &{$processName}(\$_[0]->[$i], $_[0], 1);
+        my $x = \@{$_[0]->[$i]};
+        &{$processName}(\$x, $_[0], 1);
+        splice(@{$_[0]}, $i, 1, $x);
       }
       $i += 2;
     }
@@ -1257,7 +1261,7 @@
 A true or false value; if this parameter is present and its value is
 true, then the module will insert an extra newline before the closing
 delimiter of start, end, and empty tags to guarantee that the document
-does not end up as a single, long line.  If the paramter is not
+does not end up as a single, long line.  If the parameter is not
 present, the module will not insert the newlines.
 
 =item UNSAFE

Modified: packages/libxml-writer-perl/branches/upstream/current/t/01_main.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libxml-writer-perl/branches/upstream/current/t/01_main.t?rev=3588&op=diff
==============================================================================
--- packages/libxml-writer-perl/branches/upstream/current/t/01_main.t (original)
+++ packages/libxml-writer-perl/branches/upstream/current/t/01_main.t Sat Sep  2 18:03:15 2006
@@ -2,10 +2,10 @@
 ########################################################################
 # test.pl - test script for XML::Writer module.
 # Copyright (c) 1999 by Megginson Technologies.
-# Copyright (c) 2004, 2005 by Joseph Walton <joe at kafsemo.org>.
+# Copyright (c) 2004 - 2006 by Joseph Walton <joe at kafsemo.org>.
 # No warranty.  Commercial and non-commercial use freely permitted.
 #
-# $Id: 01_main.t,v 1.22 2005/06/30 21:57:52 josephw Exp $
+# $Id: 01_main.t 164 2006-09-01 14:01:45Z josephw $
 ########################################################################
 
 # Before 'make install' is performed this script should be runnable with
@@ -13,7 +13,7 @@
 
 use strict;
 
-use Test::More(tests => 207);
+use Test::More(tests => 213);
 
 
 # Catch warnings
@@ -1736,6 +1736,39 @@
 EOR
 }
 
+# Bug report: [cpan #14854] Broken namespace report
+# Passing a list reference as an argument should work more than once
+TEST: {
+	my $t = ['uri:test', 'elem'];
+
+	initEnv(PREFIX_MAP => {'uri:test' => 'prefix'});
+
+	$w->startTag($t);
+	ok(eval {$w->emptyTag($t);}, 'Passing an array twice should not cause failure');
+	$w->endTag($t);
+	$w->end();
+
+	checkResult(<<"EOR", 'An array passed by reference should not be modified');
+<prefix:elem xmlns:prefix="uri:test"><prefix:elem /></prefix:elem>
+EOR
+}
+
+# As per #14854, list references should also work for attribute names
+TEST: {
+	my $t = ['uri:test', 'elem'];
+
+	initEnv(PREFIX_MAP => {'uri:test' => 'prefix'});
+
+	$w->startTag('x', $t => '');
+	ok(eval {$w->emptyTag('y', $t => '');}, 'Passing an array twice should not cause failure');
+	$w->endTag('x');
+	$w->end();
+
+	checkResult(<<"EOR", 'An array passed by reference should not be modified');
+<x prefix:elem="" xmlns:prefix="uri:test"><y prefix:elem="" /></x>
+EOR
+}
+
 
 # Free test resources
 $outputFile->close() or die "Unable to close temporary file: $!";




More information about the Pkg-perl-cvs-commits mailing list