r10573 - in /trunk/libxml-xpath-perl: Makefile.PL debian/ debian/changelog debian/compat debian/control debian/copyright debian/libxml-xpath-perl.docs debian/rules debian/watch examples/xpath t/base.t
vdanjean at users.alioth.debian.org
vdanjean at users.alioth.debian.org
Sat Dec 1 12:40:53 UTC 2007
Author: vdanjean
Date: Sat Dec 1 12:40:53 2007
New Revision: 10573
URL: http://svn.debian.org/wsvn/?sc=1&rev=10573
Log:
[svn-inject] Applying Debian modifications to trunk
Added:
trunk/libxml-xpath-perl/debian/
trunk/libxml-xpath-perl/debian/changelog
trunk/libxml-xpath-perl/debian/compat
trunk/libxml-xpath-perl/debian/control
trunk/libxml-xpath-perl/debian/copyright
trunk/libxml-xpath-perl/debian/libxml-xpath-perl.docs
trunk/libxml-xpath-perl/debian/rules (with props)
trunk/libxml-xpath-perl/debian/watch
trunk/libxml-xpath-perl/t/base.t
Modified:
trunk/libxml-xpath-perl/Makefile.PL
trunk/libxml-xpath-perl/examples/xpath
Modified: trunk/libxml-xpath-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/trunk/libxml-xpath-perl/Makefile.PL?rev=10573&op=diff
==============================================================================
--- trunk/libxml-xpath-perl/Makefile.PL (original)
+++ trunk/libxml-xpath-perl/Makefile.PL Sat Dec 1 12:40:53 2007
@@ -7,10 +7,10 @@
WriteMakefile(
'NAME' => 'XML::XPath',
'VERSION_FROM' => 'XPath.pm', # finds $VERSION
- 'AUTHOR' => 'Matt Sergeant, AxKit.com Ltd',
- 'ABSTRACT_FROM' => 'XPath.pm',
- 'PREREQ_PM' => {
- 'XML::Parser' => '2.23',
- },
- 'EXE_FILES' => [ 'examples/xpath' ],
+ 'AUTHOR' => 'Matt Sergeant, FastNet Software Ltd',
+ 'ABSTRACT_FROM' => 'XPath.pm',
+ 'PREREQ_PM' => {
+ 'XML::Parser' => '2.23',
+ },
+ 'EXE_FILES' => [ 'examples/xpath' ],
);
Added: trunk/libxml-xpath-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libxml-xpath-perl/debian/changelog?rev=10573&op=file
==============================================================================
--- trunk/libxml-xpath-perl/debian/changelog (added)
+++ trunk/libxml-xpath-perl/debian/changelog Sat Dec 1 12:40:53 2007
@@ -1,0 +1,128 @@
+libxml-xpath-perl (1.13-6) unstable; urgency=low
+
+ * Adds debian/watch file so uscan will work
+
+ -- Jay Bonci <jaybonci at debian.org> Wed, 27 Oct 2004 13:22:30 -0400
+
+libxml-xpath-perl (1.13-5) unstable; urgency=low
+
+ * New Maintainer (Closes: #210547)
+ * Removed README file from installation as it is merely a copy of the manpage
+ * Removed .install file as it is no longer needed.
+ * Bumped policy version to 3.6.1.0 (No other changes)
+
+ -- Jay Bonci <jaybonci at debian.org> Mon, 15 Mar 2004 16:01:10 -0500
+
+libxml-xpath-perl (1.13-4) unstable; urgency=low
+
+ * debian/control: updated sections according to latest archive changes:
+ - 'libxml-xpath-perl' from 'interpreters' to 'perl'
+ * debian/control: upgraded build dependency on 'debhelper' to '>= 4.1'
+ * debian/control: upgraded to Debian Policy 3.6.0 (no changes)
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Thu, 4 Sep 2003 22:19:27 -0500
+
+libxml-xpath-perl (1.13-3) unstable; urgency=low
+
+ * examples/xpath: fixed erroneous handling of filenames containing a '-'
+ (closes: Bug#185292)
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Wed, 19 Mar 2003 21:25:14 -0600
+
+libxml-xpath-perl (1.13-2) unstable; urgency=low
+
+ * examples/xpath: fixed various small typos in the POD
+ (closes: Bug#180508)
+ * debian/rules: moved debhelper compatibility level setting to
+ 'debian/compat' per latest debhelper best practices
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Mon, 10 Mar 2003 19:23:41 -0600
+
+libxml-xpath-perl (1.13-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/control: upgraded to Debian Policy 3.5.8 (no changes)
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Wed, 29 Jan 2003 15:42:13 -0600
+
+libxml-xpath-perl (1.12-1) unstable; urgency=low
+
+ * New upstream release
+ (closes: Bug#160156)
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Fri, 20 Sep 2002 20:06:32 -0500
+
+libxml-xpath-perl (1.11-2) unstable; urgency=low
+
+ * debian/rules: upgraded to debhelper v4
+ * debian/control: changed build dependency on debhelper accordingly
+ * debian/rules: migrated from 'dh_movefiles' to 'dh_install'
+ * debian/rules: split off 'install' target from 'binary-indep' target
+ * debian/copyright: added pointer to license
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Thu, 8 Aug 2002 20:41:35 -0500
+
+libxml-xpath-perl (1.11-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/control: upgraded to Debian Policy 3.5.6
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Fri, 16 Nov 2001 19:32:31 -0600
+
+libxml-xpath-perl (1.10-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/control: upgraded to Debian Policy 3.5.5
+ * debian/control: upgraded to Debian Perl Policy 1.20
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Sun, 2 Sep 2001 18:05:42 -0500
+
+libxml-xpath-perl (1.09-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Tue, 24 Apr 2001 20:06:16 -0500
+
+libxml-xpath-perl (1.08-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/control: updated debhelper dependency to remove dh_testversion
+ * debian/control: upgraded to Debian Policy 3.5.2
+ * debian/control: upgraded to Debian Perl Policy 1.17
+ * debian/rules: upgraded to Debian Perl Policy 1.17
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Sun, 15 Apr 2001 19:48:42 -0500
+
+libxml-xpath-perl (1.04-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Fri, 19 Jan 2001 19:51:20 -0600
+
+libxml-xpath-perl (1.03-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/control: upgraded to Debian Policy 3.2.1
+ * debian/rules: upgraded to debhelper v3
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Wed, 17 Jan 2001 14:13:13 -0600
+
+libxml-xpath-perl (1.02-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Tue, 3 Oct 2000 21:50:17 -0500
+
+libxml-xpath-perl (0.99-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Fri, 8 Sep 2000 12:44:28 +0200
+
+libxml-xpath-perl (0.55-1) unstable; urgency=low
+
+ * examples/xpath: patched by Fabien Ninoles <fabien at Nightbird.TZoNE.ORG>
+ (thanks Fabien!)
+ * Initial Release
+
+ -- Ardo van Rangelrooij <ardo at debian.org> Fri, 21 Jul 2000 10:07:36 +0200
Added: trunk/libxml-xpath-perl/debian/compat
URL: http://svn.debian.org/wsvn/trunk/libxml-xpath-perl/debian/compat?rev=10573&op=file
==============================================================================
--- trunk/libxml-xpath-perl/debian/compat (added)
+++ trunk/libxml-xpath-perl/debian/compat Sat Dec 1 12:40:53 2007
@@ -1,0 +1,1 @@
+4
Added: trunk/libxml-xpath-perl/debian/control
URL: http://svn.debian.org/wsvn/trunk/libxml-xpath-perl/debian/control?rev=10573&op=file
==============================================================================
--- trunk/libxml-xpath-perl/debian/control (added)
+++ trunk/libxml-xpath-perl/debian/control Sat Dec 1 12:40:53 2007
@@ -1,0 +1,17 @@
+Source: libxml-xpath-perl
+Section: perl
+Priority: optional
+Maintainer: Jay Bonci <jaybonci at debian.org>
+Standards-Version: 3.6.1.0
+Build-Depends-Indep: debhelper (>= 4.1), perl, libxml-parser-perl
+
+Package: libxml-xpath-perl
+Section: perl
+Priority: optional
+Architecture: all
+Depends: ${perl:Depends}, libxml-parser-perl
+Description: Perl module for processing XPath
+ This module implements the W3C's XPath specification. It aims to be
+ completely correct to the letter of the spec, and yet still allow
+ extensions through the use of functions and variables, such as are
+ provided by XSLT and XPointer.
Added: trunk/libxml-xpath-perl/debian/copyright
URL: http://svn.debian.org/wsvn/trunk/libxml-xpath-perl/debian/copyright?rev=10573&op=file
==============================================================================
--- trunk/libxml-xpath-perl/debian/copyright (added)
+++ trunk/libxml-xpath-perl/debian/copyright Sat Dec 1 12:40:53 2007
@@ -1,0 +1,21 @@
+This package was debianized by Ardo van Rangelrooij <ardo at debian.org>
+on Tue, Jul 18, 2000, 21:32:50 +0200.
+
+It was downloaded from the Comprehensive Perl Archive Network (CPAN).
+Visit <http://www.cpan.org/> to find a CPAN site near you.
+
+Upstream Author: Matt Sergeant <matt at sergeant.org>
+
+Copyright:
+
+This module is copyright 2000 Fastnet Software Ltd. This is free
+software, and as such comes with NO WARRANTY. No dates are used in this
+module. You may distribute this module under the terms of either the
+Gnu GPL, or under specific licencing from Fastnet Software Ltd.
+Special free licencing consideration will be given to similarly free
+software. Please don't flame me for this licence - I've put a lot of
+hours into this code, and if someone uses my software in their product
+I expect them to have the courtesy to contact me first.
+
+On a Debian system a copy of the GNU General Public License can be
+found in the file '/usr/share/common-licenses/GPL'.
Added: trunk/libxml-xpath-perl/debian/libxml-xpath-perl.docs
URL: http://svn.debian.org/wsvn/trunk/libxml-xpath-perl/debian/libxml-xpath-perl.docs?rev=10573&op=file
==============================================================================
--- trunk/libxml-xpath-perl/debian/libxml-xpath-perl.docs (added)
+++ trunk/libxml-xpath-perl/debian/libxml-xpath-perl.docs Sat Dec 1 12:40:53 2007
@@ -1,0 +1,1 @@
+TODO
Added: trunk/libxml-xpath-perl/debian/rules
URL: http://svn.debian.org/wsvn/trunk/libxml-xpath-perl/debian/rules?rev=10573&op=file
==============================================================================
--- trunk/libxml-xpath-perl/debian/rules (added)
+++ trunk/libxml-xpath-perl/debian/rules Sat Dec 1 12:40:53 2007
@@ -1,0 +1,53 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+# export DH_COMPAT=4
+
+PACKAGE=`pwd | sed -e "s/.*\/\\(.*\\)-.*/\\1/"`
+
+
+build:
+ dh_testdir
+ # Add here commands to compile the package.
+ perl Makefile.PL verbose INSTALLDIRS=vendor
+clean:
+ dh_testdir
+ dh_testroot
+
+ -$(MAKE) clean
+ rm -f Makefile.old
+ dh_clean
+
+install:
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ $(MAKE) PREFIX=$(CURDIR)/debian/$(PACKAGE)/usr OPTIMIZE="-O2 -g -Wall" test install
+ -find $(CURDIR)/debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
+
+binary-arch:;
+binary-indep: build install
+ dh_testdir
+ dh_testroot
+ dh_installdocs
+ dh_installman
+ dh_installchangelogs
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_perl
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
Propchange: trunk/libxml-xpath-perl/debian/rules
------------------------------------------------------------------------------
svn:executable = *
Added: trunk/libxml-xpath-perl/debian/watch
URL: http://svn.debian.org/wsvn/trunk/libxml-xpath-perl/debian/watch?rev=10573&op=file
==============================================================================
--- trunk/libxml-xpath-perl/debian/watch (added)
+++ trunk/libxml-xpath-perl/debian/watch Sat Dec 1 12:40:53 2007
@@ -1,0 +1,2 @@
+version=2
+http://www.cpan.org/modules/by-module/XML/XML-XPath-([0-9].*)\.tar.gz
Modified: trunk/libxml-xpath-perl/examples/xpath
URL: http://svn.debian.org/wsvn/trunk/libxml-xpath-perl/examples/xpath?rev=10573&op=diff
==============================================================================
--- trunk/libxml-xpath-perl/examples/xpath (original)
+++ trunk/libxml-xpath-perl/examples/xpath Sat Dec 1 12:40:53 2007
@@ -1,73 +1,114 @@
#!/usr/bin/perl -w
+
+eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
+ if 0; # not running under some shell
use strict;
$| = 1;
-unless (@ARGV >= 1) {
+use XML::XPath;
+
+my @paths;
+my $pipeline;
+my $SUFFIX = "\n";
+my $PREFIX = "";
+my $quiet = 0;
+
+
+PARSE: while ((@ARGV >= 1) && ($ARGV[0] =~ /^-./ )) {
+ OPTIONS: {
+ if ($ARGV[0] eq "-e") {
+ shift;
+ push @paths, shift;
+ last OPTIONS;
+ }
+ if ($ARGV[0] eq "-p") {
+ shift;
+ $PREFIX = shift;
+ last OPTIONS;
+ }
+ if ($ARGV[0] eq "-s") {
+ shift;
+ $SUFFIX = shift;
+ last OPTIONS;
+ }
+ if ($ARGV[0] eq "-q") {
+ $quiet = 1;
+ shift;
+ last OPTIONS;
+ }
+ print STDERR "Unknown option ignore: ", shift;
+ }
+}
+
+unless (@paths >= 1) {
print STDERR qq(Usage:
-$0 [filename] query
+$0 [options] -e query [-e query...] [filename...]
- If no filename is given, supply XML on STDIN.
+ If no filenams are given, supply XML on STDIN.
+ You must provide at least one query. Each supplementary
+ query is done in order, the previous query giving the
+ context of the next one.
+
+ Options:
+
+ -q quiet. Only output the resulting PATH
+ -s suffix use suffix instead of linefeed.
+ -p postfix use prefix instead of nothing.
);
exit;
}
-use XML::XPath;
-
-my $xpath;
-
-my $pipeline;
-
-if ($ARGV[0] eq '-p') {
- # pipeline mode
- $pipeline = 1;
- shift @ARGV;
-}
-if (@ARGV >= 2) {
- $xpath = XML::XPath->new(filename => shift(@ARGV));
-}
-else {
- $xpath = XML::XPath->new(ioref => \*STDIN);
-}
-
-my $nodes = $xpath->find(shift @ARGV);
-
-unless ($nodes->isa('XML::XPath::NodeSet')) {
-NOTNODES:
- print STDERR "Query didn't return a nodeset. Value: ";
- print $nodes->value, "\n";
- exit;
-}
-
-if ($pipeline) {
- $nodes = find_more($nodes);
- goto NOTNODES unless $nodes->isa('XML::XPath::NodeSet');
-}
-
-if ($nodes->size) {
- print STDERR "Found ", $nodes->size, " nodes:\n";
- foreach my $node ($nodes->get_nodelist) {
- print STDERR "-- NODE --\n";
- print $node->toString;
- }
-}
-else {
- print STDERR "No nodes found";
-}
-
-print STDERR "\n";
+do
+{
+ my $xpath;
+ my @curpaths = @paths;
+ my $filename;
+ if (@ARGV >= 1) {
+ $filename = shift @ARGV;
+ $xpath = XML::XPath->new(filename => $filename);
+ }
+ else {
+ $filename = 'stdin';
+ $xpath = XML::XPath->new(ioref => \*STDIN);
+ }
+
+ my $nodes = $xpath->find(shift @curpaths);
+
+ if ($nodes->isa('XML::XPath::NodeSet')) {
+ while (@curpaths >= 1) {
+ $nodes = find_more($xpath, shift @curpaths, $nodes);
+ last unless $nodes->isa('XML::XPath::NodeSet');
+ }
+ }
+
+ if ($nodes->isa('XML::XPath::NodeSet')) {
+ if ($nodes->size) {
+ print STDERR "Found ", $nodes->size, " nodes in $filename:\n" unless $quiet;
+ foreach my $node ($nodes->get_nodelist) {
+ print STDERR "-- NODE --\n" unless $quiet;
+ print $PREFIX, $node->toString, $SUFFIX;
+ }
+ }
+ else {
+ print STDERR "No nodes found in $filename" unless $quiet;
+ }
+ }
+ else {
+ print STDERR "Query didn't return a nodeset. Value: ";
+ print $nodes->value, "\n";
+ }
+
+} until (@ARGV < 1);
exit;
sub find_more {
+ my $xpath = shift;
+ my $find = shift;
my ($nodes) = @_;
- if (!@ARGV) {
- return $nodes;
- }
my $newnodes = XML::XPath::NodeSet->new;
-
- my $find = shift @ARGV;
foreach my $node ($nodes->get_nodelist) {
my $new = $xpath->find($find, $node);
@@ -79,5 +120,83 @@
}
}
- return find_more($newnodes);
+ return $newnodes;
}
+
+__END__
+
+=head1 NAME
+
+xpath - a script to query XPath statements in XML documents.
+
+=head1 SYNOPSIS
+
+B<xpath [-s suffix] [-p prefix] [-q] -e query [-e query] ... [file] ...>
+
+=head1 DESCRIPTION
+
+B<xpath> uses the L<XML::XPath|XML::XPath> perl module to make XPath queries
+to any XML document. The L<XML::XPath|XML::XPath> module aims to comply exactly
+to the XPath specification at C<http://www.w3.org/TR/xpath> and yet
+allows extensions to be added in the form of functions.
+
+The script takes any number of XPath pointers and tries to apply them
+to each XML document given on the command line. If no file arguments
+are given, the query is done using C<STDIN> as an XML document.
+
+When multiple queries exist, the result of the last query is used as
+context for the next query and only the result of the last one is output.
+The context of the first query is always the root of the current document.
+
+=head1 OPTIONS
+
+=head2 B<-q>
+
+Be quiet. Output only errors (and no separator) on stderr.
+
+=head2 B<-s suffix>
+
+Place C<suffix> at the end of each entry. Default is a linefeed.
+
+=head2 B<-p prefix>
+
+Place C<prefix> preceding each entry. Default is nothing.
+
+=head1 BUGS
+
+The author of this man page is not very fluant in english. Please,
+send him (L<fabien at tzone.org>) any corrections concerning this text.
+
+See also L<XML::XPath(3pm)>.
+
+=head1 SEE ALSO
+
+L<XML::XPath(3pm)>.
+
+=head1 HISTORY
+
+This module is copyright 2000 Fastnet Software Ltd. This is free
+software, and as such comes with NO WARRANTY. No dates are used in this
+module. You may distribute this module under the terms of either the
+Gnu GPL, or under specific licencing from Fastnet Software Ltd.
+Special free licencing consideration will be given to similarly free
+software. Please don't flame me for this licence - I've put a lot of
+hours into this code, and if someone uses my software in their product
+I expect them to have the courtesy to contact me first.
+
+Full support for this module is available from Fastnet Software Ltd on
+a pay per incident basis. Alternatively subscribe to the Perl-XML
+mailing list by mailing lyris at activestate.com with the text:
+
+ SUBSCRIBE Perl-XML
+
+in the body of the message. There are lots of friendly people on the
+list, including myself, and we'll be glad to get you started.
+
+Matt Sergeant, matt at sergeant.org
+
+This man page was added as well as some serious modifications to the script
+by Fabien Ninoles <fabien at debian.org> for the Debian Project.
+
+=cut
+
Added: trunk/libxml-xpath-perl/t/base.t
URL: http://svn.debian.org/wsvn/trunk/libxml-xpath-perl/t/base.t?rev=10573&op=file
==============================================================================
--- trunk/libxml-xpath-perl/t/base.t (added)
+++ trunk/libxml-xpath-perl/t/base.t Sat Dec 1 12:40:53 2007
@@ -1,0 +1,52 @@
+print "1..6\n";
+use XML::XPath;
+use XML::XPath::Parser;
+use XML::XPath::XMLParser;
+
+# $XML::XPath::Debug = 1;
+
+my $p = XML::XPath->new( filename => 'examples/test.xml' );
+if ($p) { print "ok 1\n"; }
+else { print "not ok 1\n"; }
+
+my $pp = XML::XPath::Parser->new();
+if ($pp) { print "ok 2\n"; }
+else { print "not ok 2\n"; }
+
+$pp->parse("variable('amount', number(number(./rate/text()) * number(./units_worked/text())))");
+
+my $path = $pp->parse('.//
+ tag/
+ child::*/
+ processing-instruction("Fred")/
+ self::node()[substr("33", 1, 1)]/
+ attribute::ra[../@gunk]
+ [(../../@att="va\'l") and (@bert = "geee")]
+ [position() = child::para/fred]
+ [0 -.3]/
+ geerner[(farp | blert)[predicate[@vee]]]');
+
+if ($path) { print "ok 3\n"; }
+else { print "not ok 3\n"; }
+
+#$path = $pp->parse('param|title');
+
+warn "PATH: ", $path->as_string, "\n\n";
+
+if ($path->as_string) { # eq q^(self::node()/descendant-or-self::node()/child::tag/child::*/child::processing-instruction('Fred')/child::id((child::xml/child::vccc/child::bbbb/attribute::fer))/self::node()[(substr(('33'),(1),(1)))]/attribute::ra[(parent::node()/attribute::gunk)][((parent::node()/parent::node()/attribute::att = ('va'l')) and ((attribute::bert = ('geee'))))][(position() = (child::para/child::fred))][(.3)]/child::geerner[((child::fart | (child::blert))[(child::predicate[(attribute::vee)])])])^ ) {
+ print "ok 4\n";
+}
+else { print "not ok 4\n"; }
+
+my $nodes = $p->find('/timesheet//wednesday');
+
+# warn "$nodes size: ", $nodes->size, "\n";
+
+if ($nodes->size) { print "ok 5\n"; }
+else { print "not ok 5\n"; }
+
+foreach my $node ($nodes->get_nodelist) {
+ warn "NODES:\n", XML::XPath::XMLParser::as_string($node), "\n\n";
+}
+
+print "ok 6\n";
More information about the Pkg-perl-cvs-commits
mailing list