Corrected normalization - only adjacent text nodes should be combined

This commit is contained in:
jez 2010-12-17 10:18:14 +00:00
parent d947908c68
commit 7e9722ddc3

View file

@ -102,13 +102,11 @@ class NodeImpl : virtual public DOM::Node_impl<stringT, string_adaptorT>
{
DOMNode_implT*next = child->getNextSibling();
if((child->getNodeType() == DOM::Node_base::TEXT_NODE) ||
(child->getNodeType() == DOM::Node_base::CDATA_SECTION_NODE))
if(child->getNodeType() == DOM::Node_base::TEXT_NODE)
{
DOMText_implT* textNode = dynamic_cast<DOMText_implT*>(child);
while((next != 0) &&
((next->getNodeType() == DOM::Node_base::TEXT_NODE) ||
(next->getNodeType() == DOM::Node_base::CDATA_SECTION_NODE)))
(next->getNodeType() == DOM::Node_base::TEXT_NODE))
{
textNode->appendData(next->getNodeValue());
removeChild(next);