Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: dperrett [...] cambridge.org
Cc:
AdminCc:

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



Subject: LibXML Text node method replaceDataString
Date: Tue, 31 May 2011 11:41:16 +0100
To: bug-XML-LibXML [...] rt.cpan.org
From: Daniel Perrett <dperrett [...] cambridge.org>
Hello I'm using LibXML 1.65 with ActiveState Perl 5.10 on Windows XP Professional 32 Bit. The stringwise replace function replaceDataString for text nodes in LibXML.pm currently uses a regular expression and escapes brackets, sigils, etc. s/([\\\*\+\^\{\}\&\?\[\]\(\)\$\%\@])/\\$1/g; However it doesn't escape dots, which seems to be the reason why running replaceDataString('.', '', 'g') cleared the contents of my text nodes instead of just deleting the dots. This looks like it's a problem on version 1.70 too, and also in the function deleteDataString. Presumably, it's just a question of adding \. to the two groups. Daniel
On Tue May 31 06:41:26 2011, dperrett@cambridge.org wrote: Show quoted text
> Hello > > I'm using LibXML 1.65 with ActiveState Perl 5.10 on Windows XP > Professional 32 Bit. > > The stringwise replace function replaceDataString for text nodes in > LibXML.pm currently uses a regular expression and escapes brackets, > sigils, etc. > > s/([\\\*\+\^\{\}\&\?\[\]\(\)\$\%\@])/\\$1/g; > > However it doesn't escape dots, which seems to be the reason why running > replaceDataString('.', '', 'g') cleared the contents of my text nodes > instead of just deleting the dots. > > This looks like it's a problem on version 1.70 too, and also in the > function deleteDataString. Presumably, it's just a question of adding \. > to the two groups. > > Daniel
Hi, thanks for the report. I already implemented the fix to replaceDataString, but I did it by using http://perldoc.perl.org/functions/quotemeta.html instead of the incomplete list of special characters. I will implement deleteDataString next. See my maintenance repository at: https://bitbucket.org/shlomif/perl-xml-libxml
Subject: Re: [rt.cpan.org #68564] LibXML Text node method replaceDataString
Date: Mon, 13 Jun 2011 16:52:51 +0100
To: bug-XML-LibXML [...] rt.cpan.org
From: Daniel Perrett <dperrett [...] cambridge.org>
Thanks for this! Daniel From: "Shlomi Fish via RT" <bug-XML-LibXML@rt.cpan.org> To: dperrett@cambridge.org Date: 09/06/2011 15:44 Subject: [rt.cpan.org #68564] LibXML Text node method replaceDataString <URL: https://rt.cpan.org/Ticket/Display.html?id=68564 > On Tue May 31 06:41:26 2011, dperrett@cambridge.org wrote: Show quoted text
> Hello > > I'm using LibXML 1.65 with ActiveState Perl 5.10 on Windows XP > Professional 32 Bit. > > The stringwise replace function replaceDataString for text nodes in > LibXML.pm currently uses a regular expression and escapes brackets, > sigils, etc. > > s/([\\\*\+\^\{\}\&\?\[\]\(\)\$\%\@])/\\$1/g; > > However it doesn't escape dots, which seems to be the reason why running
Show quoted text
> replaceDataString('.', '', 'g') cleared the contents of my text nodes > instead of just deleting the dots. > > This looks like it's a problem on version 1.70 too, and also in the > function deleteDataString. Presumably, it's just a question of adding \.
Show quoted text
> to the two groups. > > Daniel
Hi, thanks for the report. I already implemented the fix to replaceDataString, but I did it by using http://perldoc.perl.org/functions/quotemeta.html instead of the incomplete list of special characters. I will implement deleteDataString next. See my maintenance repository at: https://bitbucket.org/shlomif/perl-xml-libxml
Thanks for the report. Fixed in 1.71 which was uploaded to CPAN. Regards, -- Shlomi Fish