elena       2002/08/16 13:41:18

  Modified:    java/src/org/apache/xerces/impl/dtd XMLDTDValidator.java
  Log:
  emptyElement should not call handleEndElement if validator is removed from the
  pipeline.
  
  Revision  Changes    Path
  1.31      +12 -8     
xml-xerces/java/src/org/apache/xerces/impl/dtd/XMLDTDValidator.java
  
  Index: XMLDTDValidator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dtd/XMLDTDValidator.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- XMLDTDValidator.java      16 Aug 2002 18:08:37 -0000      1.30
  +++ XMLDTDValidator.java      16 Aug 2002 20:41:18 -0000      1.31
  @@ -742,13 +742,15 @@
       public void emptyElement(QName element, XMLAttributes attributes, Augmentations 
augs)
       throws XNIException {
   
  -        handleStartElement(element, attributes);
  +        boolean removed = handleStartElement(element, attributes);
   
           if (fDocumentHandler !=null) {
               fDocumentHandler.emptyElement(element, attributes, augs);
           }
  -
  -        handleEndElement(element, augs, true);
  +        if (!removed) {
  +            handleEndElement(element, augs, true);
  +        }
  +        
   
       } // emptyElement(QName,XMLAttributes)
   
  @@ -1764,8 +1766,10 @@
       // Protected methods
       //
   
  -    /** Handle element. */
  -    protected void handleStartElement(QName element, XMLAttributes attributes) 
throws XNIException {
  +    /** Handle element
  +     * @return true if validator is removed from the pipeline
  +     */
  +    protected boolean handleStartElement(QName element, XMLAttributes attributes) 
throws XNIException {
   
           // REVISIT: Here are current assumptions about validation features
           //          given that XMLSchema validator is in the pipeline
  @@ -1817,7 +1821,7 @@
               // modify pipeline
               if (fDocumentSource !=null ) {
                   fDocumentSource.setDocumentHandler(fDocumentHandler);
  -                return;
  +                return true;
               }
           }
           else {
  @@ -1879,7 +1883,7 @@
           fElementQNamePartsStack[fElementDepth].setValues(fCurrentElement); 
           fElementIndexStack[fElementDepth] = fCurrentElementIndex;
           fContentSpecTypeStack[fElementDepth] = fCurrentContentSpecType;
  -
  +        return false;
   
       } // handleStartElement(QName,XMLAttributes,boolean)
   
  
  
  

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

Reply via email to