r35813 - in /trunk/libxml-xpathengine-perl: Changes META.yml debian/changelog debian/control lib/XML/XPathEngine.pm lib/XML/XPathEngine/NodeSet.pm t/01_basic.t t/minitree.pm

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Tue May 19 05:26:30 UTC 2009


Author: ryan52-guest
Date: Tue May 19 05:26:25 2009
New Revision: 35813

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=35813
Log:
* New upstream release
* Add myself to Uploaders
* Debian Policy 3.8.1

Modified:
    trunk/libxml-xpathengine-perl/Changes
    trunk/libxml-xpathengine-perl/META.yml
    trunk/libxml-xpathengine-perl/debian/changelog
    trunk/libxml-xpathengine-perl/debian/control
    trunk/libxml-xpathengine-perl/lib/XML/XPathEngine.pm
    trunk/libxml-xpathengine-perl/lib/XML/XPathEngine/NodeSet.pm
    trunk/libxml-xpathengine-perl/t/01_basic.t
    trunk/libxml-xpathengine-perl/t/minitree.pm

Modified: trunk/libxml-xpathengine-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xpathengine-perl/Changes?rev=35813&op=diff
==============================================================================
--- trunk/libxml-xpathengine-perl/Changes (original)
+++ trunk/libxml-xpathengine-perl/Changes Tue May 19 05:26:25 2009
@@ -1,6 +1,9 @@
 Revision history for XML::XPathEngine
 
-version 011
+version 0.12
+added:  findvalues method which returns the results as a list of strings
+
+version 0.11
 fix:    axis_descendant returns descendants in incorrect order.
         found and patched by Kumagai Kentaro
         http://rt.cpan.org/Ticket/Display.html?id=35049

Modified: trunk/libxml-xpathengine-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xpathengine-perl/META.yml?rev=35813&op=diff
==============================================================================
--- trunk/libxml-xpathengine-perl/META.yml (original)
+++ trunk/libxml-xpathengine-perl/META.yml Tue May 19 05:26:25 2009
@@ -1,11 +1,11 @@
 --- #YAML:1.0
 name:                XML-XPathEngine
-version:             0.11
+version:             0.12
 abstract:            a re-usable XPath engine for DOM-like trees
 license:             ~
 author:              
     - Michel Rodriguez <mirod at cpan.org>
-generated_by:        ExtUtils::MakeMaker version 6.44
+generated_by:        ExtUtils::MakeMaker version 6.42
 distribution_type:   module
 requires:     
     Test::More:                    0

Modified: trunk/libxml-xpathengine-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xpathengine-perl/debian/changelog?rev=35813&op=diff
==============================================================================
--- trunk/libxml-xpathengine-perl/debian/changelog (original)
+++ trunk/libxml-xpathengine-perl/debian/changelog Tue May 19 05:26:25 2009
@@ -1,10 +1,16 @@
-libxml-xpathengine-perl (0.11-2) UNRELEASED; urgency=low
+libxml-xpathengine-perl (0.12-1) UNRELEASED; urgency=low
 
+  [ gregor herrmann ]
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
     (source stanza).
   * debian/control: Added: ${misc:Depends} to Depends: field.
 
- -- gregor herrmann <gregoa at debian.org>  Sun, 16 Nov 2008 20:49:35 +0100
+  [ Ryan Niebur ]
+  * New upstream release
+  * Add myself to Uploaders
+  * Debian Policy 3.8.1
+
+ -- Ryan Niebur <ryanryan52 at gmail.com>  Mon, 18 May 2009 22:26:18 -0700
 
 libxml-xpathengine-perl (0.11-1) unstable; urgency=low
 

Modified: trunk/libxml-xpathengine-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xpathengine-perl/debian/control?rev=35813&op=diff
==============================================================================
--- trunk/libxml-xpathengine-perl/debian/control (original)
+++ trunk/libxml-xpathengine-perl/debian/control Tue May 19 05:26:25 2009
@@ -6,8 +6,8 @@
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Jeremiah C. Foster <jeremiah at jeremiahfoster.com>,
  gregor herrmann <gregor+debian at comodo.priv.at>,
- Damyan Ivanov <dmn at debian.org>
-Standards-Version: 3.7.3
+ Damyan Ivanov <dmn at debian.org>, Ryan Niebur <ryanryan52 at gmail.com>
+Standards-Version: 3.8.1
 Homepage: http://search.cpan.org/dist/XML-XPathEngine/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libxml-xpathengine-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libxml-xpathengine-perl/

Modified: trunk/libxml-xpathengine-perl/lib/XML/XPathEngine.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xpathengine-perl/lib/XML/XPathEngine.pm?rev=35813&op=diff
==============================================================================
--- trunk/libxml-xpathengine-perl/lib/XML/XPathEngine.pm (original)
+++ trunk/libxml-xpathengine-perl/lib/XML/XPathEngine.pm Tue May 19 05:26:25 2009
@@ -5,7 +5,7 @@
 
 use vars qw($VERSION $AUTOLOAD $revision);
 
-$VERSION = '0.11';
+$VERSION = '0.12';
 $XML::XPathEngine::Namespaces = 0;
 $XML::XPathEngine::DEBUG = 0;
 
@@ -164,6 +164,16 @@
       #{ return $results->to_literal; }
     return $results->value;
 }
+
+sub findvalues {
+    my $self = shift;
+    my ($path, $context) = @_;
+    my $results = $self->find( $path, $context);
+    if ($results->isa('XML::XPathEngine::NodeSet')) 
+      { return $results->string_values; }
+    return ($results->string_value);
+}
+
 
 sub exists
 {
@@ -1054,6 +1064,10 @@
 Returns the result as a string (the concatenation of the values of the
 result nodes).
 
+=head2 findvalues($path, $context)
+
+Returns the values of the result nodes as a list of strings.
+
 =head2 exists ($path, $context)
 
 Returns true if the given path exists.

Modified: trunk/libxml-xpathengine-perl/lib/XML/XPathEngine/NodeSet.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xpathengine-perl/lib/XML/XPathEngine/NodeSet.pm?rev=35813&op=diff
==============================================================================
--- trunk/libxml-xpathengine-perl/lib/XML/XPathEngine/NodeSet.pm (original)
+++ trunk/libxml-xpathengine-perl/lib/XML/XPathEngine/NodeSet.pm Tue May 19 05:26:25 2009
@@ -131,11 +131,15 @@
 			);
 }
 
-sub to_final_value{
+sub to_final_value {
 	my $self = CORE::shift;
 	return join('', map { $_->string_value } @$self);
 }
 
+sub string_values {
+	my $self = CORE::shift;
+	return map { $_->string_value } @$self;
+}
 1;
 __END__
 
@@ -177,6 +181,11 @@
 Returns the string-value of the first node in the list.
 See the XPath specification for what "string-value" means.
 
+=head2 string_values()
+
+Returns a list of the string-values of all the nodes in the list.
+
+
 =head2 to_literal()
 
 Returns the concatenation of all the string-values of all

Modified: trunk/libxml-xpathengine-perl/t/01_basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xpathengine-perl/t/01_basic.t?rev=35813&op=diff
==============================================================================
--- trunk/libxml-xpathengine-perl/t/01_basic.t (original)
+++ trunk/libxml-xpathengine-perl/t/01_basic.t Tue May 19 05:26:25 2009
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 31;
+use Test::More tests => 33;
 use XML::XPathEngine;
 
 BEGIN { push @INC, './t'; }
@@ -12,6 +12,7 @@
 my $xp   = XML::XPathEngine->new;
 
 #warn $tree->as_xml, "\n\n";
+
 {
 my @root_nodes= $xp->findnodes( '/root', $tree);
 is( join( ':', map { $_->value } @root_nodes), 'root_value', q{findnodes( '/root', $tree)});
@@ -68,6 +69,9 @@
 is( $xp->findvalue( 'id("i3")//*[1]/@att2', $tree), 'vv', 'id descendants attribute');
 is( $xp->findvalue( '(id("i3")//*)[1]/@att2', $tree), 'vv', 'grouped id descendants attribute');
 is( $xp->findvalue( 'substring-after((id("i2")//*[1])/@att2, "v")', $tree), 'v', 'substring-after(id())');
+
+is( join( '|', $xp->findvalues( '//kid1[@att1=~/v[345]/]', $tree)), 'vkid3|vkid5', "findvalues match on attributes");
+is( join( '|', $xp->findvalues( '//kid1[@att1=~/v[345]/]/@id', $tree)), 'i9|i15', "findvalues on attributes");
 
 sub init_tree
   { my $id=0;

Modified: trunk/libxml-xpathengine-perl/t/minitree.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xpathengine-perl/t/minitree.pm?rev=35813&op=diff
==============================================================================
--- trunk/libxml-xpathengine-perl/t/minitree.pm (original)
+++ trunk/libxml-xpathengine-perl/t/minitree.pm Tue May 19 05:26:25 2009
@@ -88,12 +88,9 @@
 
   sub dump
     { my $self= shift;
+      my @fields= qw( name value pos);
       return   "$$self : " 
-      # . join ( " - ", grep { $_ } map { "$_ : " . ${$self->$_} if( $self->$_) }  
-      #                                       qw( parent next_sibling previous_sibling first_child)
-      #             )
-      #      . ' : '
-             . join ( " - ", map { "$_ : " . $self->$_ }  (qw( name value pos)) )
+             . join ( " - ", map { "$_ : " . $self->$_ }  @fields )
              . " : " . join( " - ", map { $_->dump } @{$self->attributes})
              ;
     }




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