mrglavas 2005/04/13 11:27:04 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.46 +21 -3 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.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- XIncludeHandler.java 13 Apr 2005 17:33:45 -0000 1.45 +++ XIncludeHandler.java 13 Apr 2005 18:27:04 -0000 1.46 @@ -830,7 +830,16 @@ Augmentations augs) throws XNIException { fDepth++; - setState(getState(fDepth - 1)); + int lastState = getState(fDepth - 1); + // If the last two states were fallback then this must be a descendant of an include + // child which isn't a fallback. The specification says we should ignore such elements + // and their children. + if (lastState == STATE_EXPECT_FALLBACK && getState(fDepth - 2) == STATE_EXPECT_FALLBACK) { + setState(STATE_IGNORE); + } + else { + setState(lastState); + } // we process the xml:base and xml:lang attributes regardless // of what type of element it is. @@ -891,7 +900,16 @@ Augmentations augs) throws XNIException { fDepth++; - setState(getState(fDepth - 1)); + int lastState = getState(fDepth - 1); + // If the last two states were fallback then this must be a descendant of an include + // child which isn't a fallback. The specification says we should ignore such elements + // and their children. + if (lastState == STATE_EXPECT_FALLBACK && getState(fDepth - 2) == STATE_EXPECT_FALLBACK) { + setState(STATE_IGNORE); + } + else { + setState(lastState); + } // we process the xml:base and xml:lang attributes regardless // of what type of element it is.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]