From: cantor Date: Tue, 21 Mar 2006 05:00:31 +0000 (+0000) Subject: Block unmarshall when a DOM or parent exists. X-Git-Tag: 1.4.1~768 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=commitdiff_plain;h=909278fd770087a0f1a8a8a891f8288cac54e23c Block unmarshall when a DOM or parent exists. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@55 de75baf8-a10c-0410-a50a-987c0e22f00f --- diff --git a/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp b/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp index 797b035..12e0327 100644 --- a/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp +++ b/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp @@ -43,6 +43,9 @@ XMLObject* AbstractXMLObjectUnmarshaller::unmarshall(DOMElement* element, bool b xmltooling::NDC ndc("unmarshall"); #endif + if (getDOM() || hasParent()) + throw UnmarshallingException("Object already contains data, it cannot be unmarshalled at this stage."); + if (!XMLString::equals(element->getNamespaceURI(),getElementQName().getNamespaceURI()) || !XMLString::equals(element->getLocalName(),getElementQName().getLocalPart())) { throw UnmarshallingException("Unrecognized element supplied to implementation for unmarshalling.");