You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@apache.org on 2001/08/06 07:17:55 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/xni/parser XMLDTDContentModelSource.java XMLDTDScanner.java XMLDTDSource.java XMLDocumentScanner.java XMLDocumentSource.java

andyc       01/08/05 22:17:55

  Modified:    java/src/org/apache/xerces/impl Tag: xerces_j_2
                        XMLValidator.java
               java/src/org/apache/xerces/parsers Tag: xerces_j_2
                        StandardParserConfiguration.java
  Added:       java/src/org/apache/xerces/impl Tag: xerces_j_2
                        XMLDTDScannerImpl.java XMLDocumentScannerImpl.java
               java/src/org/apache/xerces/xni/parser Tag: xerces_j_2
                        XMLDTDContentModelSource.java XMLDTDScanner.java
                        XMLDTDSource.java XMLDocumentScanner.java
                        XMLDocumentSource.java
  Removed:     java/src/org/apache/xerces/impl Tag: xerces_j_2
                        XMLDTDScanner.java XMLDocumentScanner.java
  Log:
  Abstracted the parser pipeline even more by defining document
  and DTD scanner interfaces. Before, XNI could define a simple
  pipeline but no way to generically start the parsing pipeline.
  
  Now we can do neat things like create parser configurations
  dynamically by setting pipelines of a scanner followed by
  zero or more filters (components that implement *both* the
  document handler and source interfaces). Yee haw!
  
  Also made changes necessary to implement these changes in
  the Xerces2 reference implementation. Next: add documentation
  to the XNI Manual about these new interfaces.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.79  +1 -2      xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLValidator.java
  
  Index: XMLValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLValidator.java,v
  retrieving revision 1.1.2.78
  retrieving revision 1.1.2.79
  diff -u -r1.1.2.78 -r1.1.2.79
  --- XMLValidator.java	2001/07/26 08:03:36	1.1.2.78
  +++ XMLValidator.java	2001/08/06 05:17:54	1.1.2.79
  @@ -122,7 +122,7 @@
    * @author Andy Clark, IBM
    * @author Jeffrey Rodriguez IBM
    *
  - * @version $Id: XMLValidator.java,v 1.1.2.78 2001/07/26 08:03:36 andyc Exp $
  + * @version $Id: XMLValidator.java,v 1.1.2.79 2001/08/06 05:17:54 andyc Exp $
    */
   public class XMLValidator
       implements XMLComponent, 
  @@ -519,7 +519,6 @@
        */
       public void reset(XMLComponentManager componentManager)
           throws XMLConfigurationException {
  -
   
           // clear grammars
           fCurrentGrammar = null;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +1857 -0   xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLDTDScannerImpl.java
  
  
  
  
  1.1.2.1   +1975 -0   xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLDocumentScannerImpl.java
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.13  +15 -9     xml-xerces/java/src/org/apache/xerces/parsers/Attic/StandardParserConfiguration.java
  
  Index: StandardParserConfiguration.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/Attic/StandardParserConfiguration.java,v
  retrieving revision 1.1.2.12
  retrieving revision 1.1.2.13
  diff -u -r1.1.2.12 -r1.1.2.13
  --- StandardParserConfiguration.java	2001/07/26 08:03:37	1.1.2.12
  +++ StandardParserConfiguration.java	2001/08/06 05:17:54	1.1.2.13
  @@ -61,9 +61,9 @@
   import java.util.Locale;
   
   import org.apache.xerces.impl.Constants;
  -import org.apache.xerces.impl.XMLDocumentScanner;
  +import org.apache.xerces.impl.XMLDocumentScannerImpl;
  +import org.apache.xerces.impl.XMLDTDScannerImpl;
   import org.apache.xerces.impl.XMLErrorReporter;
  -import org.apache.xerces.impl.XMLDTDScanner;
   import org.apache.xerces.impl.XMLEntityManager;
   import org.apache.xerces.impl.XMLValidator;
   import org.apache.xerces.impl.msg.XMLMessageFormatter;
  @@ -73,7 +73,10 @@
   import org.apache.xerces.util.SymbolTable;
   import org.apache.xerces.xni.XMLLocator;
   import org.apache.xerces.xni.XNIException;
  +import org.apache.xerces.xni.parser.XMLComponent;
   import org.apache.xerces.xni.parser.XMLConfigurationException;
  +import org.apache.xerces.xni.parser.XMLDocumentScanner;
  +import org.apache.xerces.xni.parser.XMLDTDScanner;
   import org.apache.xerces.xni.parser.XMLInputSource;
   
   //import org.xml.sax.Locator;
  @@ -109,7 +112,7 @@
    * @author Arnaud  Le Hors, IBM
    * @author Andy Clark, IBM
    *
  - * @version $Id: StandardParserConfiguration.java,v 1.1.2.12 2001/07/26 08:03:37 andyc Exp $
  + * @version $Id: StandardParserConfiguration.java,v 1.1.2.13 2001/08/06 05:17:54 andyc Exp $
    */
   public class StandardParserConfiguration
       extends BasicParserConfiguration {
  @@ -295,12 +298,16 @@
   
           fScanner = createDocumentScanner();
           fProperties.put(DOCUMENT_SCANNER, fScanner);
  -        addComponent(fScanner);
  +        if (fScanner instanceof XMLComponent) {
  +            addComponent((XMLComponent)fScanner);
  +        }
   
           fDTDScanner = createDTDScanner();
           if (fDTDScanner != null) {
               fProperties.put(DTD_SCANNER, fDTDScanner);
  -            addComponent(fDTDScanner);
  +            if (fDTDScanner instanceof XMLComponent) {
  +                addComponent((XMLComponent)fDTDScanner);
  +            }
           }
   
           fValidator = createValidator();
  @@ -385,8 +392,7 @@
   
           try {
               reset();
  -            fEntityManager.setEntityHandler(fScanner);
  -            fEntityManager.startDocumentEntity(source);
  +            fScanner.setInputSource(source);
               fScanner.scanDocument(true);
           } 
           catch (XNIException ex) {
  @@ -594,12 +600,12 @@
   
       /** Create a document scanner. */
       protected XMLDocumentScanner createDocumentScanner() {
  -        return new XMLDocumentScanner();
  +        return new XMLDocumentScannerImpl();
       } // createDocumentScanner():XMLDocumentScanner
   
       /** Create a DTD scanner. */
       protected XMLDTDScanner createDTDScanner() {
  -        return new XMLDTDScanner();
  +        return new XMLDTDScannerImpl();
       } // createDTDScanner():XMLDTDScanner
   
       /** Create a validator. */
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +84 -0     xml-xerces/java/src/org/apache/xerces/xni/parser/Attic/XMLDTDContentModelSource.java
  
  
  
  
  1.1.2.1   +136 -0    xml-xerces/java/src/org/apache/xerces/xni/parser/Attic/XMLDTDScanner.java
  
  
  
  
  1.1.2.1   +84 -0     xml-xerces/java/src/org/apache/xerces/xni/parser/Attic/XMLDTDSource.java
  
  
  
  
  1.1.2.1   +112 -0    xml-xerces/java/src/org/apache/xerces/xni/parser/Attic/XMLDocumentScanner.java
  
  
  
  
  1.1.2.1   +84 -0     xml-xerces/java/src/org/apache/xerces/xni/parser/Attic/XMLDocumentSource.java
  
  
  
  

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