Skip Menu |

This queue is for tickets about the XML-Saxon-XSLT2 CPAN distribution.

Report information
The Basics
Id: 60589
Status: resolved
Worked: 5 min
Priority: 0/
Queue: XML-Saxon-XSLT2

People
Owner: perl [...] toby.ink
Requestors: mauricemengel [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: usage more explicit?
Date: Sat, 21 Aug 2010 09:23:39 -0400
To: bug-xml-saxon-xslt2 <bug-xml-saxon-xslt2 [...] rt.cpan.org>
From: Maurice Mengel <mauricemengel [...] gmail.com>
Hi there, i got my first transformation running. Great module! I'm using v0.033 BTW. Maybe it would be good to add a little to the synopsis to make it more intuitive 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); print $trans->transform($input); Maurice
I've improves the SYNOPSIS section in my working copy. Don't know when the next release will be, but it will include the following 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'); By the way, someone pointed me to this message: http://sourceforge.net/mailarchive/message.php? msg_name=AANLkTinepW8MJwtB3p%2B%2BJDz02Egn7c3btvkeJ%3DMFFuEX %40mail.gmail.com I say that XML::LibXSLT is probably more reliable than XML::Saxon::XSLT2 for two reasons: it's been released longer, so is probably better tested; it uses XS to connect to the XSLT engine rather than Inline. If XML::Saxon::XSLT2 works for you, then it will probably work just as reliably as XML::LibXSLT, but it can be fiddly to get working - making sure Java JAR files are in the right places, etc. -Toby