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