diff --git a/include/DOM/SAX2DOM/SAX2DOM.hpp b/include/DOM/SAX2DOM/SAX2DOM.hpp index 7baf59e4..bd688e6f 100644 --- a/include/DOM/SAX2DOM/SAX2DOM.hpp +++ b/include/DOM/SAX2DOM/SAX2DOM.hpp @@ -325,8 +325,17 @@ class Parser : protected Arabica::SAX::DefaultHandlerdtd_pseudo_entity == name) return; - - currentNode_.appendChild(document_.createEntityReference(name)); + + const EntityT* declared = declaredEntities_[name]; + if(declared != 0 && declared->getLength() != 0) + { + for(DOM::Node child = declared->getFirstChild(); + child != 0; + child = child.getNextSibling()) + currentNode_.appendChild(child.cloneNode(true)); + } + else + currentNode_.appendChild(document_.createEntityReference(name)); } // endEntity virtual void startCDATA()