Skip Menu |

This queue is for tickets about the libxml-enno CPAN distribution.

Report information
The Basics
Id: 5628
Status: new
Priority: 0/
Queue: libxml-enno

Owner: Nobody in particular
Requestors: cpan [...]

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

Subject: NOT_FOUND_ERR on removeAttribute under certain conditions
Download (untitled) / with headers
text/plain 1.5k
(Using libxml-enno 1.02 from the perl-libxml-enno-1.02-15 RPM from RedHat 7.3 with perl v5.6.1 on a mostly stock RH7.3 box.) Calling removeAttribute on an element with no attributes raises a NOT_FOUND_ERR exception. This exception doesn't occur if there are any attributes on the element even if none match the argument to removeAttribute. The DOM spec doesn't list a NOT_FOUND_ERR exception for removeAttribute. The code responsible appears to be the croak in XML/ sub removeAttribute { my ($self, $name) = @_; my $attr = $self->[_A]; unless (defined $attr) { croak new XML::DOM::DOMException (NOT_FOUND_ERR); return; } Here is a demonstration script: my $parser = new XML::DOM::Parser; my $document1 = $parser->parse(<<EOF); <?xml version="1.0" standalone='yes'?> <main present="yes"> </main> EOF my $main1 = $document1->getDocumentElement; print "Removing something from first document\n"; $main1->removeAttribute("something"); my $document2 = $parser->parse(<<EOF); <?xml version="1.0" standalone='yes'?> <main> </main> EOF my $main2 = $document2->getDocumentElement; print "Removing something from second document\n"; $main2->removeAttribute("something");

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to