You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2001/12/03 17:29:23 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs XMLSchemaValidator.java

sandygao    01/12/03 08:29:23

  Modified:    java/src/org/apache/xerces/impl/xs XMLSchemaValidator.java
  Log:
  Should pop the namespace context after we finish process the element content.
  Otherwise if the type of the element is QName, the value won't be validated correctly.
  
  Thanks to Neeraj's patch.
  
  Revision  Changes    Path
  1.15      +10 -5     xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
  
  Index: XMLSchemaValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XMLSchemaValidator.java	2001/11/30 19:29:22	1.14
  +++ XMLSchemaValidator.java	2001/12/03 16:29:23	1.15
  @@ -121,7 +121,7 @@
    * @author Andy Clark IBM
    * @author Jeffrey Rodriguez IBM
    * @author Neeraj Bajaj, Sun Microsystems, inc.
  - * @version $Id: XMLSchemaValidator.java,v 1.14 2001/11/30 19:29:22 sandygao Exp $
  + * @version $Id: XMLSchemaValidator.java,v 1.15 2001/12/03 16:29:23 sandygao Exp $
    */
   public class XMLSchemaValidator
                implements XMLComponent, XMLDocumentFilter, FieldActivator {
  @@ -1351,10 +1351,6 @@
        */
       XMLString handleEndElement(QName element) {
   
  -        // need to pop context so that the bindings for this element is
  -        // discarded.
  -        fNamespaceSupport.popContext();
  -
           // if we are skipping, return
           if (fSkipValidationDepth >= 0) {
               // but if this is the top element that we are skipping,
  @@ -1374,6 +1370,11 @@
               else {
                   fElementDepth--;
               }
  +
  +            // need to pop context so that the bindings for this element is
  +            // discarded.
  +            fNamespaceSupport.popContext();
  +
               return null;
           }
   
  @@ -1441,6 +1442,10 @@
               fCurrCMState = fCMStateStack[fElementDepth];
               fSawCharacters = fStringContent[fElementDepth];
           }
  +
  +        // need to pop context so that the bindings for this element is
  +        // discarded.
  +        fNamespaceSupport.popContext();
   
           return defaultValue;
       } // handleEndElement(QName,boolean)*/
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org