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 2006/06/30 20:48:36 UTC

svn commit: r418359 - /xerces/java/trunk/src/org/apache/xerces/impl/XMLDocumentScannerImpl.java

Author: mrglavas
Date: Fri Jun 30 11:48:35 2006
New Revision: 418359

URL: http://svn.apache.org/viewvc?rev=418359&view=rev
Log:
Fixing JIRA Bug #1169:
http://issues.apache.org/jira/browse/XERCESJ-1169

If grammar caching is enabled and a document has both an internal and
external DTD subset endDTD() was never being called. This was causing
the DOM builder to drop all of the text in the document. This should
now be fixed as well as another bug which could lead to an NPE if
the validation feature is enabled but the load external DTD feature
is disabled.

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/XMLDocumentScannerImpl.java

Modified: xerces/java/trunk/src/org/apache/xerces/impl/XMLDocumentScannerImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/XMLDocumentScannerImpl.java?rev=418359&r1=418358&r2=418359&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/XMLDocumentScannerImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/XMLDocumentScannerImpl.java Fri Jun 30 11:48:35 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2005 The Apache Software Foundation.
+ * Copyright 1999-2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -935,8 +935,8 @@
                             // REVISIT: Should there be a feature for
                             //          the "complete" parameter?
                             boolean completeDTD = true;
-
-                            boolean moreToScan = fDTDScanner.scanDTDInternalSubset(completeDTD, fStandalone, fHasExternalDTD && fLoadExternalDTD);
+                            boolean readExternalSubset = (fValidation || fLoadExternalDTD) && (fValidationManager == null || !fValidationManager.isCachedDTD());
+                            boolean moreToScan = fDTDScanner.scanDTDInternalSubset(completeDTD, fStandalone, fHasExternalDTD && readExternalSubset);
                             if (!moreToScan) {
                                 // end doctype declaration
                                 if (!fEntityScanner.skipChar(']')) {
@@ -951,15 +951,13 @@
 
                                 // scan external subset next
                                 if (fDoctypeSystemId != null) {
-                                    if ((fValidation || fLoadExternalDTD) 
-                                        && (fValidationManager == null || !fValidationManager.isCachedDTD())) {
+                                    if (readExternalSubset) {
                                         setScannerState(SCANNER_STATE_DTD_EXTERNAL);
                                         break;
                                     }
                                 }
                                 else if (fExternalSubsetSource != null) {
-                                    if ((fValidation || fLoadExternalDTD) 
-                                        && (fValidationManager == null || !fValidationManager.isCachedDTD())) {
+                                    if (readExternalSubset) {
                                         // This handles the case of a DOCTYPE that only had an internal subset.
                                         fDTDScanner.setInputSource(fExternalSubsetSource);
                                         fExternalSubsetSource = null;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org