This is an automated email from the git hooks/post-receive script. js pushed a commit to tag 0.007 in repository libxml-saxon-xslt2-perl.
commit 6a73de953f2619b83e9fb9483e5cd74a438c8373 Author: Toby Inkster <m...@tobyinkster.co.uk> Date: Fri Feb 18 23:25:21 2011 +0000 release 0.004 - fairly minor update --HG-- branch : XML-Saxon-XSLT2 extra : convert_revision : svn%3A3fe8e991-6959-4966-b76d-b07eca2b6e37/XML-Saxon-XSLT2%40667 --- Changes | 4 ++ Changes.ttl | 13 +++++- Changes.xml | 102 +++++++++++++++++++++++++++++++++++++++++++ META.yml | 4 +- README | 26 ++++++++++- XML-Saxon-XSLT2-0.004.tar.gz | Bin 0 -> 33876 bytes lib/XML/Saxon/XSLT2.pm | 28 ++++++++++-- t/01basic.t | 4 +- 8 files changed, 171 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index 72ca919..4eb973f 100644 --- a/Changes +++ b/Changes @@ -10,6 +10,10 @@ Home page: <http://search.cpan.org/dist/XML-Saxon-XSLT2/> Bug tracker: <http://rt.cpan.org/Dist/Display.html?Queue=XML-Saxon-XSLT2> Maintainer: Toby Inkster <mailto:toby...@cpan.org> +0.004 [2011-02-18] + - (Addition) Allow parameters to be passed through to Inline::Java from + the 'use' line. + 0.003 [2010-07-19] - (Addition) Can determine <xsl:output> media-type, doctype-public, doctype-system, encoding and version attributes. diff --git a/Changes.ttl b/Changes.ttl index 3619e55..830b071 100644 --- a/Changes.ttl +++ b/Changes.ttl @@ -52,6 +52,17 @@ my:v_0-003 dcs:item [ rdfs:label "Can determine <xsl:output> media-type, doctype-public, doctype-system, encoding and version attributes."@en ; a dcs:Addition ] ] . +my:v_0-004 + + a :Version ; + dc:issued "2011-02-18"^^xsd:date ; + :revision "0.004"^^xsd:string ; + :file-release <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/XML-Saxon-XSLT2-0.004.tar.gz> ; + dcs:changeset [ + dcs:versus my:v_0-003 ; + dcs:item [ rdfs:label "Allow parameters to be passed through to Inline::Java from the 'use' line."@en ; a dcs:Addition ] + ] . + ############################################################# my:project @@ -70,7 +81,7 @@ my:project :tester toby:i ; :created "2010-07-14"^^xsd:date ; :license <http://dev.perl.org/licenses/> ; - :release my:v_0-001 , my:v_0-002 , my:v_0-003 . + :release my:v_0-001 , my:v_0-002 , my:v_0-003 , my:v_0-004 . ############################################################# diff --git a/Changes.xml b/Changes.xml index e69de29..9293dcf 100644 --- a/Changes.xml +++ b/Changes.xml @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8"?> +<rdf:RDF xmlns:dbug="http://ontologi.es/doap-bugs#" xmlns:dc="http://purl.org/dc/terms/" xmlns:dcs="http://ontologi.es/doap-changeset#" xmlns:doap="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> +<rdf:Description rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r0"> + <dcs:item rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r1"/> + <dcs:item rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r2"/> + <dcs:item rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r3"/> + <dcs:versus rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-001"/> +</rdf:Description> +<rdf:Description rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r1"> + <rdf:type rdf:resource="http://ontologi.es/doap-changeset#Addition"/> + <rdfs:label xml:lang="en">Can capture output from <xsl:message>.</rdfs:label> +</rdf:Description> +<rdf:Description rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r2"> + <rdf:type rdf:resource="http://ontologi.es/doap-changeset#Addition"/> + <rdfs:label xml:lang="en">Can specify a base URI in the constructor.</rdfs:label> +</rdf:Description> +<rdf:Description rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r3"> + <rdfs:label xml:lang="en">No longer default to 'xml' output method, but respect XSLT's specified output method.</rdfs:label> +</rdf:Description> +<rdf:Description rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r4"> + <dcs:item rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r5"/> + <dcs:versus rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-002"/> +</rdf:Description> +<rdf:Description rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r5"> + <rdf:type rdf:resource="http://ontologi.es/doap-changeset#Addition"/> + <rdfs:label xml:lang="en">Can determine <xsl:output> media-type, doctype-public, doctype-system, encoding and version attributes.</rdfs:label> +</rdf:Description> +<rdf:Description rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r6"> + <dcs:item rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r7"/> + <dcs:versus rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-003"/> +</rdf:Description> +<rdf:Description rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r7"> + <rdf:type rdf:resource="http://ontologi.es/doap-changeset#Addition"/> + <rdfs:label xml:lang="en">Allow parameters to be passed through to Inline::Java from the 'use' line.</rdfs:label> +</rdf:Description> +<rdf:Description rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r8"> + <doap:browse rdf:resource="http://goddamn.co.uk/viewvc/perlmods/XML-Saxon-XSLT2/"/> + <rdf:type rdf:resource="http://usefulinc.com/ns/doap#SVNRepository"/> +</rdf:Description> +<rdf:Description rdf:about="file:///home/tai/src/perlmods/XML-Saxon-XSLT2/Changes.ttl"> + <dc:creator rdf:resource="http://tobyinkster.co.uk/#i"/> + <dc:description xml:lang="en">Revision history for Perl extension XML::Saxon::XSLT2.</dc:description> + <dc:subject rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/project"/> + <dc:title>Changes</dc:title> +</rdf:Description> +<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/project"> + <doap:bug-database rdf:resource="http://rt.cpan.org/Dist/Display.html?Queue=XML-Saxon-XSLT2"/> + <doap:created rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-07-14</doap:created> + <doap:developer rdf:resource="http://tobyinkster.co.uk/#i"/> + <doap:documenter rdf:resource="http://tobyinkster.co.uk/#i"/> + <doap:download-page rdf:resource="http://search.cpan.org/dist/XML-Saxon-XSLT2/"/> + <doap:homepage rdf:resource="http://search.cpan.org/dist/XML-Saxon-XSLT2/"/> + <doap:license rdf:resource="http://dev.perl.org/licenses/"/> + <doap:maintainer rdf:resource="http://tobyinkster.co.uk/#i"/> + <doap:name>XML-Saxon-XSLT2</doap:name> + <doap:programming-language>Perl</doap:programming-language> + <doap:release rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-001"/> + <doap:release rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-002"/> + <doap:release rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-003"/> + <doap:release rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-004"/> + <doap:repository rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r8"/> + <doap:shortdesc xml:lang="en">process XSLT 2.0 using Saxon 9.x</doap:shortdesc> + <doap:tester rdf:resource="http://tobyinkster.co.uk/#i"/> + <rdf:type rdf:resource="http://usefulinc.com/ns/doap#Project"/> +</rdf:Description> +<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-001"> + <dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-07-15</dc:issued> + <doap:file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/XML-Saxon-XSLT2-0.001.tar.gz"/> + <doap:revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.001</doap:revision> + <rdf:type rdf:resource="http://usefulinc.com/ns/doap#Version"/> + <rdfs:label xml:lang="en">Original version</rdfs:label> +</rdf:Description> +<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-002"> + <dcs:changeset rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r0"/> + <dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-07-15</dc:issued> + <doap:file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/XML-Saxon-XSLT2-0.002.tar.gz"/> + <doap:revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.002</doap:revision> + <rdf:type rdf:resource="http://usefulinc.com/ns/doap#Version"/> +</rdf:Description> +<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-003"> + <dcs:changeset rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r4"/> + <dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-07-19</dc:issued> + <doap:file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/XML-Saxon-XSLT2-0.003.tar.gz"/> + <doap:revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.003</doap:revision> + <rdf:type rdf:resource="http://usefulinc.com/ns/doap#Version"/> +</rdf:Description> +<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/XML-Saxon-XSLT2/v_0-004"> + <dcs:changeset rdf:nodeID="r7EC56C683BB511E0BA9BC194EA151372r6"/> + <dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2011-02-18</dc:issued> + <doap:file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/XML-Saxon-XSLT2-0.004.tar.gz"/> + <doap:revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.004</doap:revision> + <rdf:type rdf:resource="http://usefulinc.com/ns/doap#Version"/> +</rdf:Description> +<rdf:Description xmlns:ns1="http://www.w3.org/2002/07/owl#" rdf:about="http://tobyinkster.co.uk/#i"> + <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/> + <ns1:sameAs rdf:resource="http://purl.org/NET/cpan-uri/person/tobyink"/> + <foaf:homepage rdf:resource="http://tobyinkster.co.uk/"/> + <foaf:mbox rdf:resource="mailto:toby...@cpan.org"/> + <foaf:name>Toby Inkster</foaf:name> + <foaf:page rdf:resource="http://search.cpan.org/~tobyink/"/> +</rdf:Description> +</rdf:RDF> diff --git a/META.yml b/META.yml index d112f04..584bfcc 100644 --- a/META.yml +++ b/META.yml @@ -8,7 +8,7 @@ build_requires: configure_requires: ExtUtils::MakeMaker: 6.42 distribution_type: module -generated_by: 'Module::Install version 0.95' +generated_by: 'Module::Install version 1.00' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -31,4 +31,4 @@ resources: homepage: http://search.cpan.org/dist/XML-Saxon-XSLT2/ license: http://dev.perl.org/licenses/ repository: http://goddamn.co.uk/viewvc/perlmods/XML-Saxon-XSLT2/ -version: 0.003 +version: 0.004 diff --git a/README b/README index 48ecf33..85b9c48 100644 --- a/README +++ b/README @@ -2,8 +2,18 @@ NAME XML::Saxon::XSLT2 - process XSLT 2.0 using Saxon 9.x. SYNOPSIS + use XML::Saxon::XSLT2; + + # make sure to open filehandle in right encoding + open(my $input, '<:encoding(UTF-8)', 'path/to/xml') or die $!; + open(my $xslt, '<:encoding(UTF-8)', 'path/to/xslt') or die $!; + my $trans = XML::Saxon::XSLT2->new($xslt, $baseurl); my $output = $trans->transform($input); + print $output; + + my $output2 = $trans->transform_document($input); + my @paragraphs = $output2->getElementsByTagName('p'); DESCRIPTION This module implements XSLT 1.0 and 2.0 using Saxon 9.x via @@ -16,6 +26,14 @@ DESCRIPTION release of Saxon-HE 9.x, open the Zip archive, extract saxon9he.jar and save it to one of the two directories above. + Use Line + use XML::Saxon::XSLT2; + + You can include additional parameters which will be passed straight on + to Inline::Java, like this: + + use XML::Saxon::XSLT2 EXTRA_JAVA_ARGS => '-Xmx256m'; + Constructor "XML::Saxon::XSLT2->new($xslt, [$baseurl])" Creates a new transformation. $xslt may be a string, a file handle @@ -104,15 +122,19 @@ BUGS Please report any bugs to <http://rt.cpan.org/>. SEE ALSO - "XML::LibXSLT" is probably more reliable, and allows you to define your + XML::LibXSLT is probably more reliable, and allows you to define your own XSLT extension functions. However, the libxslt library that it's based on only supports XSLT 1.0. + Inline::Java. + + <http://saxon.sourceforge.net/>. + AUTHOR Toby Inkster <toby...@cpan.org>. COPYRIGHT - Copyright 2010 Toby Inkster + Copyright 2010-2011 Toby Inkster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/XML-Saxon-XSLT2-0.004.tar.gz b/XML-Saxon-XSLT2-0.004.tar.gz new file mode 100644 index 0000000..2a8a12b Binary files /dev/null and b/XML-Saxon-XSLT2-0.004.tar.gz differ diff --git a/lib/XML/Saxon/XSLT2.pm b/lib/XML/Saxon/XSLT2.pm index 91b7963..571f1ad 100644 --- a/lib/XML/Saxon/XSLT2.pm +++ b/lib/XML/Saxon/XSLT2.pm @@ -8,7 +8,7 @@ use IO::Handle; use Scalar::Util qw[blessed]; use XML::LibXML; -our $VERSION = '0.003'; +our $VERSION = '0.004'; my $classpath; BEGIN @@ -20,9 +20,17 @@ BEGIN { $classpath = $path if -e $path; } + + require Inline; } -use Inline Java => 'DATA', CLASSPATH=>$classpath; +sub import +{ + my ($class, @args) = @_; + shift @args + if @args && exists $args[0] && defined $args[0] && $args[0] =~ /^[\d\.\_]{1,10}$/; + Inline->import(Java => 'DATA', CLASSPATH=>$classpath, @args); +} sub new { @@ -195,6 +203,15 @@ flexible. The saxon9he.jar file can be found at L<http://saxon.sourceforge.net/> just dowload the latest Java release of Saxon-HE 9.x, open the Zip archive, extract saxon9he.jar and save it to one of the two directories above. +=head2 Use Line + + use XML::Saxon::XSLT2; + +You can include additional parameters which will be passed straight on to +Inline::Java, like this: + + use XML::Saxon::XSLT2 EXTRA_JAVA_ARGS => '-Xmx256m'; + =head2 Constructor =over 4 @@ -303,13 +320,17 @@ L<XML::LibXSLT> is probably more reliable, and allows you to define your own XSLT extension functions. However, the libxslt library that it's based on only supports XSLT 1.0. +L<Inline::Java>. + +L<http://saxon.sourceforge.net/>. + =head1 AUTHOR Toby Inkster E<lt>toby...@cpan.orge<gt>. =head1 COPYRIGHT -Copyright 2010 Toby Inkster +Copyright 2010-2011 Toby Inkster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -531,3 +552,4 @@ public class Transformer return sw.toString(); } } + diff --git a/t/01basic.t b/t/01basic.t index f511172..f3cfe2c 100644 --- a/t/01basic.t +++ b/t/01basic.t @@ -1,5 +1,5 @@ -use Test::More tests => 5; -BEGIN { use_ok('XML::Saxon::XSLT2') }; +use Test::More tests => 4; +use XML::Saxon::XSLT2; my $xslt = <<'XSLT'; <?xml version="1.0" encoding="UTF-8"?> -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libxml-saxon-xslt2-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits