Expand entity references in the DOM

This commit is contained in:
Jez Higgins 2012-09-14 19:44:29 +01:00
parent 6d07f4a42d
commit 2f88819306

View file

@ -326,6 +326,15 @@ class Parser : protected Arabica::SAX::DefaultHandler<stringT, typename ParserTy
if(this->dtd_pseudo_entity == name)
return;
const EntityT* declared = declaredEntities_[name];
if(declared != 0 && declared->getLength() != 0)
{
for(DOM::Node<stringT, string_adaptorT> child = declared->getFirstChild();
child != 0;
child = child.getNextSibling())
currentNode_.appendChild(child.cloneNode(true));
}
else
currentNode_.appendChild(document_.createEntityReference(name));
} // endEntity