Skip Menu |

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

Report information
The Basics
Id: 27659
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: rafl [...] debian.org
Cc:
AdminCc:

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



Hi, I'm trying to run XML::LibXML 1.63 on a Debian system with libxml2 2.6.29. Unfortunately I get two failing tests in t/03doc.t: t/03doc.......................# Test 78 got: "" (t/03doc.t at line 209) # Expected: <UNDEF> # t/03doc.t line 209 is: ok( $pi->textContent, undef); # Test 79 got: "" (t/03doc.t at line 210) # Expected: <UNDEF> # t/03doc.t line 210 is: ok( $pi->getData, undef); t/03doc.......................FAILED tests 78-79 The failing code creates a processing instruction node and checks if the textContent is undef initially. Unfortunately it isn't as the call to ->textContent() basically boils down to xmlXPathCastNodeToString(), which will, if the nodes content is NULL currently, return a newly allocated empty string. See xpath.c from the libxml2 2.6.29 distribution: xmlChar * xmlXPathCastNodeToString (xmlNodePtr node) { xmlChar *ret; if ((ret = xmlNodeGetContent(node)) == NULL) ret = xmlStrdup((const xmlChar *) ""); return(ret); } Although I couldn't find anything in the changelogs I checked out some libxml2 releases and found out that this behavior has been introduced with version 2.6.29. Previous versions of libxml2 defined this function like that: xmlChar * xmlXPathCastNodeToString (xmlNodePtr node) { return(xmlNodeGetContent(node)); } That way you'd get NULL back C2Sv would convert that to &PL_sv_undef. I'm not too sure what the right fix would be. Make the tests check for either "" or undef based on the version of libxml2 they're linked against? Have the string_value function handle NULL specially (replace it by an empty string) to make the new behavior of 2.6.29 available for older versions of libxml2 as well? What do you think? TIA, Flo
From: rnorwood [...] redhat.com
On Wed Jun 20 10:21:18 2007, FLORA wrote: Show quoted text
> Hi, > > I'm trying to run XML::LibXML 1.63 on a Debian system with libxml2 > 2.6.29. Unfortunately I get two failing tests in t/03doc.t:
For what it's worth, this bug also affects Fedora 7 (same version of libxml2)
From: pajas [...] matfyz.cz
Ok, I simply fixed the tests rather than converting "" to NULL (undef). If this change in libxml2's behavior didn't bother its direct users, I hope it won't bother users of XML::LibXML either. Since people keep reporting this rather unimportant issue in an increasing pace I'll have to release 1.64 very soon. If you can, please fetch XML::LibXML from the SVN (see README) and verify that it makes all tests pass for you. Thanks, -- Petr On út 03.čec.2007 10:06:52, rnorwood wrote: Show quoted text
> On Wed Jun 20 10:21:18 2007, FLORA wrote:
> > Hi, > > > > I'm trying to run XML::LibXML 1.63 on a Debian system with libxml2 > > 2.6.29. Unfortunately I get two failing tests in t/03doc.t:
> > For what it's worth, this bug also affects Fedora 7 (same version of > libxml2)
From: rnorwood [...] redhat.com
On Tue Jul 03 13:44:07 2007, PAJAS wrote: Show quoted text
> Ok, I simply fixed the tests rather than converting "" to NULL > (undef). If this change in libxml2's behavior didn't bother its direct > users, I hope it won't bother users of XML::LibXML either. > > Since people keep reporting this rather unimportant issue in an > increasing pace I'll have to release 1.64 very soon. If you can, > please fetch XML::LibXML from the SVN (see README) and verify that it > makes all tests pass for you. Thanks,
I'd like to, but I'm getting a 'connection refused': Instructions from: http://search.cpan.org/src/PAJAS/XML-LibXML-1.63/README [rnorwood@solitude svn]$ svn co svn://axkit.org/XML-LibXML/trunk svn: Can't connect to host 'axkit.org': Connection refused So...
From: stro [...] railways.dp.ua
On Tue Jul 03 13:44:07 2007, PAJAS wrote: Show quoted text
> Ok, I simply fixed the tests rather than converting "" to NULL > (undef). If this change in libxml2's behavior didn't bother its direct > users, I hope it won't bother users of XML::LibXML either. > > Since people keep reporting this rather unimportant issue in an > increasing pace I'll have to release 1.64 very soon. If you can, > please fetch XML::LibXML from the SVN (see README) and verify that it > makes all tests pass for you. Thanks,
Current SVN version passes 03doc.t tests, but fails on 40reader.t. You should receive MSWin32 report for 1.63 where this problem also resides: http://www.nntp.perl.org/group/perl.cpan.testers/2007/07/msg538942.html libxml2 version is recent, 2.6.29 -- Serguei Trouchelle
From: rnorwood [...] redhat.com
On Wed Jul 04 12:36:08 2007, rnorwood wrote: Show quoted text
> On Tue Jul 03 13:44:07 2007, PAJAS wrote:
> > Ok, I simply fixed the tests rather than converting "" to NULL > > (undef). If this change in libxml2's behavior didn't bother its direct > > users, I hope it won't bother users of XML::LibXML either. > > > > Since people keep reporting this rather unimportant issue in an > > increasing pace I'll have to release 1.64 very soon. If you can, > > please fetch XML::LibXML from the SVN (see README) and verify that it > > makes all tests pass for you. Thanks,
> > I'd like to, but I'm getting a 'connection refused': > > Instructions from: > > http://search.cpan.org/src/PAJAS/XML-LibXML-1.63/README > > [rnorwood@solitude svn]$ svn co svn://axkit.org/XML-LibXML/trunk > svn: Can't connect to host 'axkit.org': Connection refused > > So...
Ok, now the checkout works for me...and trunk builds and all the tests pass.