mrglavas 2005/09/15 10:47:35
Modified: java/src/org/apache/xerces/xpointer XPointerHandler.java
java/src/org/apache/xerces/xinclude XIncludeHandler.java
Log:
Fixing a bug. An ArrayIndexOutOfBoundsException could be thrown when
processing a document with a DTD with schema validation enabled. In such
a case the schema validator removes itself from the pipeline if no schema
is found for the document. These updates weren't being propogated to the
child pipelines. Should be fixed now.
Revision Changes Path
1.2 +11 -1
xml-xerces/java/src/org/apache/xerces/xpointer/XPointerHandler.java
Index: XPointerHandler.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/xpointer/XPointerHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XPointerHandler.java 17 Jun 2005 22:00:20 -0000 1.1
+++ XPointerHandler.java 15 Sep 2005 17:47:34 -0000 1.2
@@ -28,6 +28,8 @@
import org.apache.xerces.xni.Augmentations;
import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.XMLAttributes;
+import org.apache.xerces.xni.XMLDTDHandler;
+import org.apache.xerces.xni.XMLDocumentHandler;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLConfigurationException;
@@ -114,6 +116,14 @@
//fErrorReporter = errorReporter; // The XInclude ErrorReporter
}
+ public void setDocumentHandler(XMLDocumentHandler handler) {
+ fDocumentHandler = handler;
+ }
+
+ public void setDTDHandler(XMLDTDHandler handler) {
+ fDTDHandler = handler;
+ }
+
//
************************************************************************
// Implementation of the XPointerProcessor interface.
//
************************************************************************
1.59 +20 -4
xml-xerces/java/src/org/apache/xerces/xinclude/XIncludeHandler.java
Index: XIncludeHandler.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/xinclude/XIncludeHandler.java,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- XIncludeHandler.java 13 Sep 2005 20:45:04 -0000 1.58
+++ XIncludeHandler.java 15 Sep 2005 17:47:34 -0000 1.59
@@ -720,7 +720,15 @@
} // getPropertyDefault(String):Object
public void setDocumentHandler(XMLDocumentHandler handler) {
- fDocumentHandler = handler;
+ if (fDocumentHandler != handler) {
+ fDocumentHandler = handler;
+ if (fXIncludeChildConfig != null) {
+ fXIncludeChildConfig.setDocumentHandler(handler);
+ }
+ if (fXPointerChildConfig != null) {
+ fXPointerChildConfig.setDocumentHandler(handler);
+ }
+ }
}
public XMLDocumentHandler getDocumentHandler() {
@@ -1386,7 +1394,15 @@
* @see
org.apache.xerces.xni.parser.XMLDTDSource#setDTDHandler(org.apache.xerces.xni.XMLDTDHandler)
*/
public void setDTDHandler(XMLDTDHandler handler) {
- fDTDHandler = handler;
+ if (fDTDHandler != handler) {
+ fDTDHandler = handler;
+ if (fXIncludeChildConfig != null) {
+ fXIncludeChildConfig.setDTDHandler(handler);
+ }
+ if (fXPointerChildConfig != null) {
+ fXPointerChildConfig.setDTDHandler(handler);
+ }
+ }
}
// XIncludeHandler methods
@@ -1641,7 +1657,7 @@
// If an xpointer attribute is present
if (xpointer != null ) {
- fChildConfig = fXPointerChildConfig ;
+ fChildConfig = fXPointerChildConfig;
// Parse the XPointer expression
try {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]