Author: mrglavas
Date: Wed Jun 2 15:39:30 2010
New Revision: 950602
URL: http://svn.apache.org/viewvc?rev=950602&view=rev
Log:
Fixing JIRA Issue #1450: http://issues.apache.org/jira/browse/XERCESJ-1450.
Whenever we adopt a node from a deferred DOM we must ensure that the node and
the entire tree beneath has been fully materialized before transferring it to
its new owner document.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java?rev=950602&r1=950601&r2=950602&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java
Wed Jun 2 15:39:30 2010
@@ -1772,13 +1772,13 @@ extends ParentNode implements Document
// Return null if the source is null
if (source == null) {
- return null;
+ return null;
}
else if (source != null && source.getOwnerDocument() != null) {
DOMImplementation thisImpl = this.getImplementation();
DOMImplementation otherImpl =
source.getOwnerDocument().getImplementation();
-
+
// when the source node comes from a different implementation.
if (thisImpl != otherImpl) {
// Adopting from a deferred DOM to a non-deferred DOM
@@ -1795,7 +1795,12 @@ extends ParentNode implements Document
// Adopting between two dissimilar DOMs is not allowed
return null;
}
- }
+ }
+ // Adopting from a deferred DOM into another deferred DOM
+ else if (otherImpl instanceof
org.apache.xerces.dom.DeferredDOMImplementationImpl) {
+ // traverse the DOM and expand deferred nodes and then allow
adoption
+ undeferChildren (node);
+ }
}
switch (node.getNodeType()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]