Category::getInstance(XMLTOOLING_LOGCAT".DOM").error(\r
"DOM clone failed, unable to locate unmarshaller for element (%s)", q->toString().c_str()\r
);\r
+ domCopy->getOwnerDocument()->release();\r
+ throw UnmarshallingException("Unable to locate unmarshaller for cloned element.");\r
}\r
try {\r
return u->unmarshall(domCopy, true); // bind document\r
}\r
return NULL;\r
}\r
+\r
+XMLObject* AbstractDOMCachingXMLObject::prepareForAssignment(XMLObject* oldValue, XMLObject* newValue) {\r
+\r
+ if (newValue && newValue->hasParent())\r
+ throw XMLObjectException("child XMLObject cannot be added - it is already the child of another XMLObject");\r
+\r
+ if (!oldValue) {\r
+ if (newValue) {\r
+ releaseThisandParentDOM();\r
+ newValue->setParent(this);\r
+ return newValue;\r
+ }\r
+ else {\r
+ return NULL;\r
+ }\r
+ }\r
+\r
+ if (oldValue != newValue) {\r
+ delete oldValue;\r
+ releaseThisandParentDOM();\r
+ newValue->setParent(this);\r
+ }\r
+\r
+ return newValue;\r
+}\r