mrglavas 2005/05/11 08:14:25
Modified: java/src/org/apache/xerces/xinclude XIncludeHandler.java
Log:
The XInclude spec says that children of include elements which are
elements not in the XInclude namespace and descendants of these
elements are to be ignored. We were not ignoring all such content.
Revision Changes Path
1.49 +11 -6
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.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- XIncludeHandler.java 8 May 2005 18:54:10 -0000 1.48
+++ XIncludeHandler.java 11 May 2005 15:14:24 -0000 1.49
@@ -1385,11 +1385,15 @@
}
protected void handleFallbackElement() {
- setSawInclude(fDepth, false);
- fNamespaceContext.setContextInvalid();
if (!getSawInclude(fDepth - 1)) {
+ if (getState() == STATE_IGNORE) {
+ return;
+ }
reportFatalError("FallbackParent");
}
+
+ setSawInclude(fDepth, false);
+ fNamespaceContext.setContextInvalid();
if (getSawFallback(fDepth)) {
reportFatalError("MultipleFallbacks");
@@ -1408,13 +1412,14 @@
protected boolean handleIncludeElement(XMLAttributes attributes)
throws XNIException {
- setSawInclude(fDepth, true);
- fNamespaceContext.setContextInvalid();
if (getSawInclude(fDepth - 1)) {
reportFatalError("IncludeChild", new Object[] { XINCLUDE_INCLUDE
});
}
- if (getState() == STATE_IGNORE)
+ if (getState() == STATE_IGNORE) {
return true;
+ }
+ setSawInclude(fDepth, true);
+ fNamespaceContext.setContextInvalid();
// TODO: does Java use IURIs by default?
// [Definition: An internationalized URI reference, or IURI,
is a URI reference that directly uses [Unicode] characters.]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]