r18665 - in /trunk/libxml-dom-xpath-perl: Changes META.yml Makefile.PL XPath.pm debian/changelog t/test_bugs.t t/test_non_ascii.t t/xmlxpath_24namespaces.t
gregoa-guest at users.alioth.debian.org
gregoa-guest at users.alioth.debian.org
Wed Apr 16 15:09:45 UTC 2008
Author: gregoa-guest
Date: Wed Apr 16 15:09:44 2008
New Revision: 18665
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=18665
Log:
* debian/control: removed myself from Uploaders
* New upstream release.
Modified:
trunk/libxml-dom-xpath-perl/Changes
trunk/libxml-dom-xpath-perl/META.yml
trunk/libxml-dom-xpath-perl/Makefile.PL
trunk/libxml-dom-xpath-perl/XPath.pm
trunk/libxml-dom-xpath-perl/debian/changelog
trunk/libxml-dom-xpath-perl/t/test_bugs.t
trunk/libxml-dom-xpath-perl/t/test_non_ascii.t
trunk/libxml-dom-xpath-perl/t/xmlxpath_24namespaces.t
Modified: trunk/libxml-dom-xpath-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-dom-xpath-perl/Changes?rev=18665&op=diff
==============================================================================
--- trunk/libxml-dom-xpath-perl/Changes (original)
+++ trunk/libxml-dom-xpath-perl/Changes Wed Apr 16 15:09:44 2008
@@ -1,11 +1,23 @@
Revision history for Perl extension XML::DOM::XPath.
$Id: Changes,v 1.8 2005/10/18 08:39:04 mrodrigu Exp $
+
+0.14
+ - upgraded dependency to XML::XPathEngine 1.10
+ - added the findnodes_as_strings method, that returns a list of
+ strings, one for each matching node
+ - fixed RT #29423, test failing on Debian
+ see http://rt.cpan.org/Ticket/Display.html?id=29423
+ - added tests for bugs fixed in XML::XPathEngine 1.10
0.13
- removed dependency on XML::XPath in tests (spotted by
Sendu Bala)
+
+ - added warning for test failure due to using XML::Parser
+ and XML::DOM from a previous version of perl, compiled
+ with different options (spotted by Tony Awtrey)
0.12
Modified: trunk/libxml-dom-xpath-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-dom-xpath-perl/META.yml?rev=18665&op=diff
==============================================================================
--- trunk/libxml-dom-xpath-perl/META.yml (original)
+++ trunk/libxml-dom-xpath-perl/META.yml Wed Apr 16 15:09:44 2008
@@ -1,12 +1,15 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: XML-DOM-XPath
-version: 0.13
-version_from: XPath.pm
-installdirs: site
-requires:
+--- #YAML:1.0
+name: XML-DOM-XPath
+version: 0.14
+abstract: Perl extension to add XPath support to XML::DOM, using XML::XPath engine
+license: ~
+author:
+ - Michel Rodriguez <mirod at cpan.org>
+generated_by: ExtUtils::MakeMaker version 6.44
+distribution_type: module
+requires:
XML::DOM: 0
- XML::XPathEngine: 0.04
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+ XML::XPathEngine: 0.1
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
Modified: trunk/libxml-dom-xpath-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-dom-xpath-perl/Makefile.PL?rev=18665&op=diff
==============================================================================
--- trunk/libxml-dom-xpath-perl/Makefile.PL (original)
+++ trunk/libxml-dom-xpath-perl/Makefile.PL Wed Apr 16 15:09:44 2008
@@ -6,7 +6,7 @@
WriteMakefile(
NAME => 'XML::DOM::XPath',
VERSION_FROM => 'XPath.pm', # finds $VERSION
- PREREQ_PM => { XML::DOM => 0, XML::XPathEngine => 0.04 }, # e.g., Module::Name => 1.1
+ PREREQ_PM => { XML::DOM => 0, XML::XPathEngine => 0.10 }, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'XPath.pm', # retrieve abstract from module
AUTHOR => 'Michel Rodriguez <mirod at cpan.org>') : ()),
Modified: trunk/libxml-dom-xpath-perl/XPath.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-dom-xpath-perl/XPath.pm?rev=18665&op=diff
==============================================================================
--- trunk/libxml-dom-xpath-perl/XPath.pm (original)
+++ trunk/libxml-dom-xpath-perl/XPath.pm Wed Apr 16 15:09:44 2008
@@ -8,7 +8,7 @@
use XML::DOM;
use vars qw($VERSION);
-$VERSION="0.13";
+$VERSION="0.14";
my $xp_field; # the field in the document that contains the XML::XPathEngine object
my $parent_field; # the field in an attribute that contains the parent element
@@ -21,13 +21,14 @@
package XML::DOM::Document;
-sub findnodes { my( $dom, $path)= @_; return $dom->xp->findnodes( $path, $dom); }
-sub findnodes_as_string { my( $dom, $path)= @_; return $dom->xp->findnodes_as_string( $path, $dom); }
-sub findvalue { my( $dom, $path)= @_; return $dom->xp->findvalue( $path, $dom); }
-sub exists { my( $dom, $path)= @_; return $dom->xp->exists( $path, $dom); }
-sub find { my( $dom, $path)= @_; return $dom->xp->find( $path, $dom); }
-sub matches { my( $dom, $path)= @_; return $dom->xp->matches( $dom, $path, $dom); }
-sub set_namespace { my $dom= shift; $dom->xp->set_namespace( @_); }
+sub findnodes { my( $dom, $path)= @_; return $dom->xp->findnodes( $path, $dom); }
+sub findnodes_as_string { my( $dom, $path)= @_; return $dom->xp->findnodes_as_string( $path, $dom); }
+sub findnodes_as_strings { my( $dom, $path)= @_; return $dom->xp->findnodes_as_strings( $path, $dom); }
+sub findvalue { my( $dom, $path)= @_; return $dom->xp->findvalue( $path, $dom); }
+sub exists { my( $dom, $path)= @_; return $dom->xp->exists( $path, $dom); }
+sub find { my( $dom, $path)= @_; return $dom->xp->find( $path, $dom); }
+sub matches { my( $dom, $path)= @_; return $dom->xp->matches( $dom, $path, $dom); }
+sub set_namespace { my $dom= shift; $dom->xp->set_namespace( @_); }
sub cmp { return $_[1]->isa( 'XML::DOM::Document') ? 0 : 1; }
Modified: trunk/libxml-dom-xpath-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-dom-xpath-perl/debian/changelog?rev=18665&op=diff
==============================================================================
--- trunk/libxml-dom-xpath-perl/debian/changelog (original)
+++ trunk/libxml-dom-xpath-perl/debian/changelog Wed Apr 16 15:09:44 2008
@@ -1,14 +1,15 @@
-libxml-dom-xpath-perl (0.13-2) UNRELEASED; urgency=low
+libxml-dom-xpath-perl (0.14-1) UNRELEASED; urgency=low
+
+ [ David Paleino ]
+ * debian/control: removed myself from Uploaders
[ gregor herrmann ]
* debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
field (source stanza); Homepage field (source stanza). Removed:
Homepage pseudo-field (Description); XS-Vcs-Svn fields.
+ * New upstream release.
- [ David Paleino ]
- * debian/control: removed myself from Uploaders
-
- -- David Paleino <d.paleino at gmail.com> Fri, 22 Feb 2008 13:00:45 +0100
+ -- gregor herrmann <gregor+debian at comodo.priv.at> Wed, 16 Apr 2008 17:07:42 +0200
libxml-dom-xpath-perl (0.13-1) unstable; urgency=low
Modified: trunk/libxml-dom-xpath-perl/t/test_bugs.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-dom-xpath-perl/t/test_bugs.t?rev=18665&op=diff
==============================================================================
--- trunk/libxml-dom-xpath-perl/t/test_bugs.t (original)
+++ trunk/libxml-dom-xpath-perl/t/test_bugs.t Wed Apr 16 15:09:44 2008
@@ -4,7 +4,7 @@
# $Id: test_bugs.t,v 1.6 2005/03/08 09:08:42 mrodrigu Exp $
-use Test::More tests => 13;
+use Test::More tests => 21;
use XML::DOM::XPath;
ok(1, "use XML::DOM::XPath");
@@ -92,3 +92,58 @@
{ is( $doc->findvalue( '//processing-instruction()'), 'd1d2d3', '//processing-instruction()'); }
}
+{
+my $xml=qq|<?xml version="1.0" encoding="utf-8"?>
+<cdl><structure><assessments>
+<component type="labtasks" name="Lab Tasks" id="labtasks" weight="40"/>
+<component type="exam" name="Mid Term Exam" id="midterm" weight="20"/>
+<component type="exam" name="End Term Exam" id="endterm" weight="40"/>
+</assessments></structure></cdl>
+|;
+
+
+ my $xp = XML::DOM::Parser->new->parsestring($xml);
+
+ is( $xp->findvalue( 'count( //component)'), 3, 'count on its own');
+ is( 2 * $xp->findvalue( 'count( //component)'), 6, '2 * count');
+ is( $xp->findvalue( 'count( //component)') * 2, 6, 'count * 2');
+
+ {
+ my $component= ($xp->findnodes ('//structure//assessments/component'))[0];
+ my $id = $component->findvalue ('@id');
+ my $weight= $component->findvalue ('@weight');
+ my $res= 100 * $weight; # this is where things failed
+ is( $res, 4000, 'findvalue result used in an multiplication');
+ }
+
+ {
+ my $weight=($xp->findnodes_as_strings ('//structure//assessments/component/@weight'))[0];
+ my $res= 100 * $weight; # this is where things failed
+ is( $res, 4000, 'findvalue result used in an multiplication');
+ }
+}
+
+{
+ my $xml=qq|
+<text>
+ <para>I start the text here, I break
+the line and I go on, I <blink>twinkle</blink> and then I go on
+ again.
+This is not a new paragraph.</para><para>This is a
+ <important>new</important> paragraph and
+ <blink>this word</blink> has a preceding sibling.</para>
+</text>
+|;
+
+ my $xp = XML::DOM::Parser->new->parsestring( $xml);
+ ok($xp);
+
+ # Debian bug #187583, http://bugs.debian.org/187583
+ # Check that evaluation doesn't lose the context information
+
+ my $nodes = $xp->find("text/para/node()[position()=last() and preceding-sibling::important]");
+ ok("$nodes", " has a preceding sibling.");
+
+ $nodes = $xp->find("text/para/node()[preceding-sibling::important and position()=last()]");
+ ok("$nodes", " has a preceding sibling.");
+}
Modified: trunk/libxml-dom-xpath-perl/t/test_non_ascii.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-dom-xpath-perl/t/test_non_ascii.t?rev=18665&op=diff
==============================================================================
--- trunk/libxml-dom-xpath-perl/t/test_non_ascii.t (original)
+++ trunk/libxml-dom-xpath-perl/t/test_non_ascii.t Wed Apr 16 15:09:44 2008
@@ -7,16 +7,19 @@
use Test::More tests => 10;
use XML::DOM::XPath;
-use utf8;
+use encoding 'utf8';
+
+my $display_warning=0;
{
my $dom = XML::DOM::Parser->new();
my $doc = $dom->parsefile( "t/non_ascii.xml");
- is( $doc->toString, qq{<doc><ent>aü</ent><char>bü</char></doc>\n},'toString (on file)');
+ if( !$doc->toString eq "<doc><ent>aü</ent><char>bü</char></doc>\n") { $display_warning=1; }
+ is( $doc->toString, "<doc><ent>aü</ent><char>bü</char></doc>\n",'toString (on file)');
is( $doc->findvalue( '//char'), "bü", "findvalue( '//char') (on file)");
- is( $doc->findnodes_as_string( '//char'), qq{<char>bü</char>}, "findnodes_as_string( '//char') (on file)");
- is( $doc->findvalue( '//ent'), qq{aü}, "findvalue( '//ent') (on file)");
- is( $doc->findnodes_as_string( '//ent'), qq{<ent>aü</ent>}, "findnodes_as_string( '//ent') (on file)");
+ is( $doc->findnodes_as_string( '//char'), '<char>bü</char>', "findnodes_as_string( '//char') (on file)");
+ is( $doc->findvalue( '//ent'), 'aü', "findvalue( '//ent') (on file)");
+ is( $doc->findnodes_as_string( '//ent'), '<ent>aü</ent>', "findnodes_as_string( '//ent') (on file)");
}
@@ -31,4 +34,10 @@
is( $doc->findnodes_as_string( '//ent'), qq{<ent>aü</ent>}, "findnodes_as_string( '//ent') (on string)");
}
-
+if( $display_warning)
+ { warn "One possible reason why this test might fail is if XML::Parser and XML::DOM were\n",
+ "installed with a different version of perl, compiled with a different set of options.\n",
+ "For example upgrading Ubuntu from Dapper Drake to Edgy Eft will cause this test to fail.\n",
+ "Re-installing XML::Parser and XML::DOM will fix the problem.\n"
+ ;
+ }
Modified: trunk/libxml-dom-xpath-perl/t/xmlxpath_24namespaces.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-dom-xpath-perl/t/xmlxpath_24namespaces.t?rev=18665&op=diff
==============================================================================
--- trunk/libxml-dom-xpath-perl/t/xmlxpath_24namespaces.t (original)
+++ trunk/libxml-dom-xpath-perl/t/xmlxpath_24namespaces.t Wed Apr 16 15:09:44 2008
@@ -2,7 +2,7 @@
use strict;
use Test;
-plan( tests => 12);
+plan( tests => 15);
use XML::DOM::XPath;
ok(1);
@@ -28,8 +28,12 @@
$node= $t->findvalue( '//*[@attr:findme]');
ok( $node, 'attr content');
+ok( $t->findvalue('//attr:node/@attr:findme'), 'someval');
+
+ok( $t->findvalue( '//toto'), 'tata');
+ok( $t->findvalue( '//toto/@att'), 'tutu');
+
# Set namespace mappings.
-
$t->set_namespace("foo" => "flubber.example.com");
$t->set_namespace("goo" => "foobar.example.com");
More information about the Pkg-perl-cvs-commits
mailing list