mrglavas    2004/07/19 21:07:17

  Modified:    java/src/org/apache/xerces/xinclude XIncludeHandler.java
  Log:
  Applying a few bug fixes.

  

  An xi:include element must not contain any elements from

  the XInclude namespace other than xi:fallback.

  

  An xi:fallback element must not contain any elements from

  the XInclude namespace other than xi:include.

  
  Revision  Changes    Path
  1.29      +30 -1     
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.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- XIncludeHandler.java      19 Jul 2004 02:22:50 -0000      1.28
  +++ XIncludeHandler.java      20 Jul 2004 04:07:17 -0000      1.29
  @@ -722,6 +722,24 @@
           else if (isFallbackElement(element)) {
               this.handleFallbackElement();
           }
  +        else if (hasXIncludeNamespace(element)) {
  +            if (getSawInclude(fDepth - 1)) {
  +                reportFatalError(
  +                    "IncludeChild",
  +                    new Object[] { element.rawname });
  +            }
  +            if (getSawFallback(fDepth - 1)) {
  +                reportFatalError(
  +                    "FallbackChild",
  +                    new Object[] { element.rawname });
  +            }
  +            if (fDocumentHandler != null
  +                    && getState() == STATE_NORMAL_PROCESSING) {
  +                augs = modifyAugmentations(augs);
  +                attributes = processAttributes(attributes);
  +                fDocumentHandler.emptyElement(element, attributes, augs);
  +            }
  +        }
           else if (
               fDocumentHandler != null
                   && getState() == STATE_NORMAL_PROCESSING) {
  @@ -759,6 +777,17 @@
                   reportFatalError(
                       "IncludeChild",
                       new Object[] { element.rawname });
  +            }
  +            if (getSawFallback(fDepth - 1)) {
  +                reportFatalError(
  +                    "FallbackChild",
  +                    new Object[] { element.rawname });
  +            }
  +            if (fDocumentHandler != null
  +                    && getState() == STATE_NORMAL_PROCESSING) {
  +                augs = modifyAugmentations(augs);
  +                attributes = processAttributes(attributes);
  +                fDocumentHandler.emptyElement(element, attributes, augs);
               }
           }
           else if (
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to