You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2005/12/09 23:41:15 UTC
svn commit: r355621 -
/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAnnotationImpl.java
Author: mrglavas
Date: Fri Dec 9 14:41:13 2005
New Revision: 355621
URL: http://svn.apache.org/viewcvs?rev=355621&view=rev
Log:
Let adoptNode return null instead of having a special case for the PSVI DOM.
There may be other incompatible DOM implementations in the future so the
instanceof check for PSVIDocumentImpl may eventually look like a hack.
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAnnotationImpl.java
Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAnnotationImpl.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAnnotationImpl.java?rev=355621&r1=355620&r2=355621&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAnnotationImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAnnotationImpl.java Fri Dec 9 14:41:13 2005
@@ -19,7 +19,6 @@
import org.apache.xerces.xs.XSConstants;
import org.apache.xerces.xs.XSNamespaceItem;
import org.apache.xerces.dom.CoreDocumentImpl;
-import org.apache.xerces.dom.PSVIDocumentImpl;
import org.apache.xerces.parsers.SAXParser;
import org.apache.xerces.parsers.DOMParser;
@@ -163,10 +162,9 @@
Document aDocument = parser.getDocument();
Element annotation = aDocument.getDocumentElement();
Node newElem = null;
- if (futureOwner instanceof CoreDocumentImpl &&
- !(futureOwner instanceof PSVIDocumentImpl)) {
+ if (futureOwner instanceof CoreDocumentImpl) {
newElem = futureOwner.adoptNode(annotation);
- // this should never fail but if it does, import the node instead
+ // adoptNode will return null when the DOM implementations are not compatible.
if (newElem == null) {
newElem = futureOwner.importNode(annotation, true);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org