Fix to addElement

This commit is contained in:
jez_higgins 2004-01-28 21:38:17 +00:00
parent cf1ad6d8eb
commit ec5159a8f4

View file

@ -141,6 +141,11 @@ class DocumentTypeImpl : public DOM::DocumentType_impl<stringT>,
void addElement(SimpleDOM::ElementImpl<stringT, string_adaptorT>* element)
{
if(elements_.getNamedItem(element->getNodeName()) != 0)
{
delete element;
return; // already have an element decl for it
} // if ...
element->setOwnerDoc(ownerDoc_);
elements_.setNamedItem(element);
} // addElements