Skip Menu |

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

Report information
The Basics
Id: 34908
Status: resolved
Priority: 0/
Queue: XML-XPathEngine

People
Owner: Nobody in particular
Requestors: gregor+debian [...] comodo.priv.at
Cc:
AdminCc:

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



Subject: Overload broken
Date: Sat, 12 Apr 2008 13:41:12 +0200
To: bug-XML-XPathEngine [...] rt.cpan.org
From: gregor herrmann <gregor+debian [...] comodo.priv.at>
Hi, in the Debian bug tracker we have a report that shows that overloading is broken in various modules. It was originally reported against XML::XPath but seems to still apply for XML::XPathEngine. The report (containing a proposed solution and a test script) can be found at http://bugs.debian.org/460297. Please consider looking into this issue. Thanks in advance, gregor (Debian Perl Group) -- .''`. http://info.comodo.priv.at/ | gpg key ID: 0x00F3CFE4 : :' : debian: the universal operating system - http://www.debian.org/ `. `' member of https://www.vibe.at/ | how to reply: http://got.to/quote/ `- NP: Beatles
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.

From: MIROD [...] cpan.org
On Sat Apr 12 07:41:29 2008, gregor+debian@comodo.priv.at wrote: Show quoted text
> in the Debian bug tracker we have a report that shows that > overloading is broken in various modules. It was originally reported > against XML::XPath but seems to still apply for XML::XPathEngine. > > The report (containing a proposed solution and a test script) can be > found at http://bugs.debian.org/460297. Please consider looking into > this issue.
Thanks, Indeed the bug showed up in XML::XPathEngine. The fix I found though was not to set the fallback overload, but rather to get findvalue to return real strings as opposed to XML::XPathEngine::Literal objects. Those objects are useless outside of the XPath engine, so keeping them around doesn't seem to do anyone any good. Does this make sense? An updated version is at http://xmltwig.com/module/xml-xpathengine/ The bug will be tested through XML::DOM::XPath. __ mirod
Subject: Re: [rt.cpan.org #34908] Overload broken
Date: Mon, 14 Apr 2008 21:11:17 +0200
To: MIROD via RT <bug-XML-XPathEngine [...] rt.cpan.org>
From: gregor herrmann <gregor+debian [...] comodo.priv.at>
On Mon, 14 Apr 2008 04:19:34 -0400, MIROD via RT wrote: Show quoted text
> > The report (containing a proposed solution and a test script) can be > > found at http://bugs.debian.org/460297. Please consider looking into > > this issue.
> Indeed the bug showed up in XML::XPathEngine. The fix I found though was > not to set the fallback overload, but rather to get findvalue to return > real strings as opposed to XML::XPathEngine::Literal objects. Those > objects are useless outside of the XPath engine, so keeping them around > doesn't seem to do anyone any good. > Does this make sense?
Thanks alot for your quick response! I've downloaded 0.10 and tried it with Niko's testscript xpathengine-test.pl from the Debian bug report. The error is indeed gone but the results are probably not what Alexander and Niko expected: $ PERLLIB=XML-XPathEngine-0.10/lib perl xpathengine-test.pl res is 0 res is 0 res is 0 If I dump $weights{$id}, I get "$VAR1 = '';"; in fact $id itself is empty in the first place. *some times later* My digging on the code ends at the new to_final_value() in lib/XML/XPathEngine/NodeSet.pm but maybe I'm doing something wrong ... Cheers, gregor -- .''`. http://info.comodo.priv.at/ | gpg key ID: 0x00F3CFE4 : :' : debian: the universal operating system - http://www.debian.org/ `. `' member of https://www.vibe.at/ | how to reply: http://got.to/quote/ `- NP: Peter Jones: Belle's reply
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #34908] Overload broken
Date: Mon, 14 Apr 2008 21:50:52 +0200
To: bug-XML-XPathEngine [...] rt.cpan.org
From: mirod <xmltwig [...] gmail.com>
gregor+debian@comodo.priv.at via RT wrote: Show quoted text
> I've downloaded 0.10 and tried it with Niko's testscript > xpathengine-test.pl from the Debian bug report. The error is indeed > gone but the results are probably not what Alexander and Niko > expected: > > $ PERLLIB=XML-XPathEngine-0.10/lib perl xpathengine-test.pl > res is 0 > res is 0 > res is 0 > > If I dump $weights{$id}, I get "$VAR1 = '';"; in fact $id itself is > empty in the first place. > > *some times later* > > My digging on the code ends at the new to_final_value() in > lib/XML/XPathEngine/NodeSet.pm but maybe I'm doing something wrong
Yes, the test calls findvalue on the document object, it should be called on the node itself: my $id = $xp->findvalue ('@id', $component); $weights{$id} = $xp->findvalue ('@weight', $component); should be instead: my $id = $component->findvalue ('@id'); $weights{$id} = $component->findvalue ('@weight'); in $xp->findvalue ('@id', $component); the $component is ignored and what's returned is the id attribute for the document itself. Thanks for taking the time to look into this, I'll send the new version to CPAN tomorrow. -- mirod
Subject: Re: [rt.cpan.org #34908] Overload broken
Date: Mon, 14 Apr 2008 22:32:39 +0200
To: "xmltwig [...] gmail.com via RT" <bug-XML-XPathEngine [...] rt.cpan.org>
From: gregor herrmann <gregor+debian [...] comodo.priv.at>
On Mon, 14 Apr 2008 15:51:20 -0400, xmltwig@gmail.com via RT wrote: Show quoted text
> > My digging on the code ends at the new to_final_value() in > > lib/XML/XPathEngine/NodeSet.pm but maybe I'm doing something wrong
> > Yes, the test calls findvalue on the document object, it should be > called on the node itself: > > my $id = $xp->findvalue ('@id', $component); > $weights{$id} = $xp->findvalue ('@weight', $component); > > should be instead: > > my $id = $component->findvalue ('@id'); > $weights{$id} = $component->findvalue ('@weight'); > > in $xp->findvalue ('@id', $component); the $component is ignored and > what's returned is the id attribute for the document itself.
Oh, this works indeed, great. Show quoted text
> Thanks for taking the time to look into this, I'll send the new version > to CPAN tomorrow.
Thanks! One minor point: It looks like the POD for findvalue in XPathEngine.pm is not yet up to date; it still mentions to_literal instead of to_final_value. Cheers, gregor -- .''`. http://info.comodo.priv.at/ | gpg key ID: 0x00F3CFE4 : :' : debian: the universal operating system - http://www.debian.org/ `. `' member of https://www.vibe.at/ | how to reply: http://got.to/quote/ `- NP: Tom Waits: Shiver Me Timbers
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #34908] Overload broken
Date: Mon, 14 Apr 2008 22:56:48 +0200
To: bug-XML-XPathEngine [...] rt.cpan.org
From: mirod <xmltwig [...] gmail.com>
gregor+debian@comodo.priv.at via RT wrote: Show quoted text
> One minor point: It looks like the POD for findvalue in > XPathEngine.pm is not yet up to date; it still mentions to_literal > instead of to_final_value.
Nice catch, Fixed, and version 0.10 is on its way to a CPAN mirror near you. Thanks -- mirod
Subject: Re: [rt.cpan.org #34908] Overload broken
Date: Mon, 14 Apr 2008 23:08:33 +0200
To: "xmltwig [...] gmail.com via RT" <bug-XML-XPathEngine [...] rt.cpan.org>
From: gregor herrmann <gregor+debian [...] comodo.priv.at>
On Mon, 14 Apr 2008 16:56:55 -0400, xmltwig@gmail.com via RT wrote: Show quoted text
> Fixed, and version 0.10 is on its way to a CPAN mirror near you.
Great, I'll update the Debian package ASAP. Cheers, gregor -- .''`. http://info.comodo.priv.at/ | gpg key ID: 0x00F3CFE4 : :' : debian: the universal operating system - http://www.debian.org/ `. `' member of https://www.vibe.at/ | how to reply: http://got.to/quote/ `- NP: Aziza MustafĂ  Zadeh: Carnival
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.