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

Report information
The Basics
Id:
42728
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
SREZIC [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
  • 1.63
  • 1.67
  • 1.68
Fixed in:
(no value)



Subject: Registered functions cannot return supplied arguments anymore
The attached script implements a simple registered function which just returns the supplied argument. This used to work with XML::LibXSLT 1.62 and earlier versions, but stopped to work with change version 1.63 (specifically, it seems that the change svn://axkit.org/XML-LibXSLT/trunk@194 is causing the problem). Note that the sample again works if I slightly change the supplied argument, e.g. putting it in "..." is sufficient. Regards, Slaven
Subject: 10functions2.t
#!/usr/bin/perl use strict; use Test::More 'no_plan'; use XML::LibXML; use XML::LibXSLT; my $callbackNS = "http://x/x"; my $p = XML::LibXML->new; my $xsltproc = XML::LibXSLT->new; $xsltproc->register_function( $callbackNS, "some_function", sub { my($format) = @_; # return "$format"; # works return $format; # fails } ); my $xsltdoc = $p->parse_string(<<'EOF'); <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="http://x/x" > <xsl:template match="root"> <root> <xsl:value-of select="x:some_function(@format)" /> </root> </xsl:template> </xsl:stylesheet> EOF my $doc = $p->parse_string(<<EOF); <root format="foo" /> EOF my $stylesheet = $xsltproc->parse_stylesheet($xsltdoc); my $result = $stylesheet->transform($doc); is($result->findvalue("/root"), "foo") or diag $result->serialize(1);
Dne pá 23.led.2009 12:47:57, SREZIC napsal(a):
Show quoted text
> The attached script implements a simple registered function which just > returns the supplied argument. This used to work with XML::LibXSLT 1.62 > and earlier versions, but stopped to work with change version 1.63 > (specifically, it seems that the change > svn://axkit.org/XML-LibXSLT/trunk@194 is causing the problem). Note that > the sample again works if I slightly change the supplied argument, e.g. > putting it in "..." is sufficient. > > Regards, > Slaven
Fixed in the SVN, Thanks Slaven! -- Petr


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.