Block unmarshall when a DOM or parent exists.
authorScott Cantor <cantor.2@osu.edu>
Tue, 21 Mar 2006 05:00:31 +0000 (05:00 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 21 Mar 2006 05:00:31 +0000 (05:00 +0000)
xmltooling/io/AbstractXMLObjectUnmarshaller.cpp

index 797b035..12e0327 100644 (file)
@@ -43,6 +43,9 @@ XMLObject* AbstractXMLObjectUnmarshaller::unmarshall(DOMElement* element, bool b
     xmltooling::NDC ndc("unmarshall");\r
 #endif\r
 \r
+    if (getDOM() || hasParent())\r
+        throw UnmarshallingException("Object already contains data, it cannot be unmarshalled at this stage.");\r
+\r
     if (!XMLString::equals(element->getNamespaceURI(),getElementQName().getNamespaceURI()) ||\r
         !XMLString::equals(element->getLocalName(),getElementQName().getLocalPart())) {\r
         throw UnmarshallingException("Unrecognized element supplied to implementation for unmarshalling.");\r