Subject: | getElementById does not work on empty elements. |
Date: | Tue, 27 Oct 2009 20:36:21 +0100 |
To: | bug-xml-dom-lite [...] rt.cpan.org |
From: | Michael Förderer <michael.foerderer [...] gmx.de> |
Hello,
i have an Element:
<dummy id="xy" />
and the call of getElementById( 'xy' ) doesn?t work.
The error is in Parser.pm:
# deal with XML style empty tags
if ($elmnt =~ /\/$/) {
$node = $self->_handle_element_node_end($elmnt);
}
if (defined $node->getAttribute('id')) {
$self->{document}->setElementById($node->getAttribute("id"), $node);
}
The test of the Attribute 'id' must be done before the handling of empty
nodes.
regard
Michael