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 2002/09/25 17:53:47 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/parsers DTDConfiguration.java NonValidatingConfiguration.java

sandygao    2002/09/25 08:53:47

  Modified:    java/src/org/apache/xerces/dom
                        DOMValidationConfiguration.java
               java/src/org/apache/xerces/impl/dtd XMLDTDValidator.java
               java/src/org/apache/xerces/parsers DTDConfiguration.java
                        NonValidatingConfiguration.java
  Log:
  Moving the calls to ValidationManager#reset() to the classes where it gets
  created. It was called in DTD validator, but in the case where there are more
  than one DTD validator, it'll get called more than once; and when there is no
  DTD validator, it won't get called.
  
  Revision  Changes    Path
  1.6       +10 -2     xml-xerces/java/src/org/apache/xerces/dom/DOMValidationConfiguration.java
  
  Index: DOMValidationConfiguration.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMValidationConfiguration.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DOMValidationConfiguration.java	24 Sep 2002 23:16:03 -0000	1.5
  +++ DOMValidationConfiguration.java	25 Sep 2002 15:53:47 -0000	1.6
  @@ -170,6 +170,7 @@
       /** Components. */
       protected Vector fComponents;
   
  +    protected ValidationManager fValidationManager;
   
       /** Locale. */
       protected Locale fLocale;
  @@ -258,7 +259,8 @@
           setProperty(ENTITY_MANAGER, manager);
           addComponent(manager);
           
  -        setProperty(VALIDATION_MANAGER, new ValidationManager());
  +        fValidationManager = createValidationManager();
  +        setProperty(VALIDATION_MANAGER, fValidationManager);
   
   
           // add message formatters
  @@ -499,6 +501,9 @@
        */
       protected void reset() throws XNIException {
   
  +        if (fValidationManager != null)
  +            fValidationManager.reset();
  +
           int count = fComponents.size();
           for (int i = 0; i < count; i++) {
               XMLComponent c = (XMLComponent) fComponents.elementAt(i);
  @@ -566,5 +571,8 @@
   
       } // addComponent(XMLComponent)
   
  +    protected ValidationManager createValidationManager(){
  +        return new ValidationManager();
  +    }
   
   } // class XMLParser
  
  
  
  1.38      +1 -2      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.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- XMLDTDValidator.java	25 Sep 2002 14:26:29 -0000	1.37
  +++ XMLDTDValidator.java	25 Sep 2002 15:53:47 -0000	1.38
  @@ -503,7 +503,6 @@
   
   
           fValidationManager= (ValidationManager)componentManager.getProperty(VALIDATION_MANAGER);
  -        fValidationManager.reset();
           fValidationManager.addValidationState(fValidationState);
           fValidationState.resetIDTables();
           // get needed components
  
  
  
  1.7       +4 -2      xml-xerces/java/src/org/apache/xerces/parsers/DTDConfiguration.java
  
  Index: DTDConfiguration.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DTDConfiguration.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DTDConfiguration.java	24 Sep 2002 09:39:45 -0000	1.6
  +++ DTDConfiguration.java	25 Sep 2002 15:53:47 -0000	1.7
  @@ -356,7 +356,7 @@
   
           fGrammarPool = grammarPool;
           if(fGrammarPool != null){
  -        	setProperty(XMLGRAMMAR_POOL, fGrammarPool);
  +            setProperty(XMLGRAMMAR_POOL, fGrammarPool);
           }
   
           fEntityManager = createEntityManager();
  @@ -623,6 +623,8 @@
        */
       protected void reset() throws XNIException {
   
  +        if (fValidationManager != null)
  +            fValidationManager.reset();
           // configure the pipeline and initialize the components
           configurePipeline();
           super.reset();
  
  
  
  1.6       +3 -1      xml-xerces/java/src/org/apache/xerces/parsers/NonValidatingConfiguration.java
  
  Index: NonValidatingConfiguration.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/NonValidatingConfiguration.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NonValidatingConfiguration.java	24 Sep 2002 09:39:45 -0000	1.5
  +++ NonValidatingConfiguration.java	25 Sep 2002 15:53:47 -0000	1.6
  @@ -591,6 +591,8 @@
        */
       protected void reset() throws XNIException {
   
  +        if (fValidationManager != null)
  +            fValidationManager.reset();
           // configure the pipeline and initialize the components
           configurePipeline();
           super.reset();
  
  
  

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