You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2001/07/10 01:14:24 UTC

cvs commit: xml-xerces/perl/Xerces_headers/sax2 SAX2XMLReader.hpp

jasons      01/07/09 16:14:24

  Modified:    perl/Xerces_headers/parsers SAXParser.hpp
               perl/Xerces_headers/sax2 SAX2XMLReader.hpp
  Log:
  	* Xerces_headers/sax2/SAX2XMLReader.hpp (Repository):
  	* Xerces_headers/parsers/SAXParser.hpp (Repository):
  	Updated for schemas
  
  Revision  Changes    Path
  1.4       +133 -48   xml-xerces/perl/Xerces_headers/parsers/SAXParser.hpp
  
  Index: SAXParser.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/Xerces_headers/parsers/SAXParser.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SAXParser.hpp	2001/07/09 15:37:53	1.3
  +++ SAXParser.hpp	2001/07/09 23:14:20	1.4
  @@ -1,28 +1,28 @@
   /*
    * The Apache Software License, Version 1.1
  - * 
  - * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  + *
  + * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
    * reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - * 
  + *    notice, this list of conditions and the following disclaimer.
  + *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
    *    software without prior written permission. For written 
  @@ -56,12 +56,24 @@
   
   /*
    * $Log: SAXParser.hpp,v $
  - * Revision 1.3  2001/07/09 15:37:53  jasons
  + * Revision 1.4  2001/07/09 23:14:20  jasons
  + * 	* Xerces_headers/sax2/SAX2XMLReader.hpp (Repository):
    * 	* Xerces_headers/parsers/SAXParser.hpp (Repository):
  - * 	Fixed inheritance
  + * 	Updated for schemas
  + *
  + * Revision 1.16  2001/06/03 19:26:20  jberry
  + * Add support for querying error count following parse; enables simple parse without requiring error handler.
  + *
  + * Revision 1.15  2001/05/11 13:26:22  tng
  + * Copyright update.
  + *
  + * Revision 1.14  2001/05/03 19:09:25  knoaman
  + * Support Warning/Error/FatalError messaging.
  + * Validity constraints errors are treated as errors, with the ability by user to set
  + * validity constraints as fatal errors.
    *
  - * Revision 1.2  2001/05/05 23:04:42  jasons
  - * uncommented public destructors
  + * Revision 1.13  2001/03/30 16:46:57  tng
  + * Schema: Use setDoSchema instead of setSchemaValidation which makes more sense.
    *
    * Revision 1.1  2001/04/13 22:22:57  jasons
    * 	* Xerces_headers/parsers/SAXParser.hpp (Repository):
  @@ -244,9 +256,34 @@
         * validation scheme set on this parser.
         *
         * @return The ValSchemes value current set on this parser.
  +      * @see #setValidationScheme
         */
       ValSchemes getValidationScheme() const;
   
  +    /** Get the 'do schema' flag
  +      *
  +      * This method returns the state of the parser's schema processing
  +      * flag.
  +      *
  +      * @return true, if the parser is currently configured to
  +      *         understand schema, false otherwise.
  +      *
  +      * @see #setDoSchema
  +      */
  +    bool getDoSchema() const;
  +
  +    /** Get error count from the last parse operation.
  +      *
  +      * This method returns the error count from the last parse
  +      * operation. Note that this count is actually stored in the
  +      * scanner, so this method simply returns what the
  +      * scanner reports.
  +      *
  +      * @return number of errors encountered during the latest
  +      *			parse operation.
  +      */
  +    int getErrorCount() const;
  +
       /**
         * This method returns the state of the parser's namespace
         * handling capability.
  @@ -268,6 +305,18 @@
         * @see #setExitOnFirstFatalError
         */
       bool getExitOnFirstFatalError() const;
  +
  +    /**
  +      * This method returns the state of the parser's
  +      * validation-constraint-fatal flag.
  +      *
  +      * @return true, if the parser is currently configured to
  +      *         set validation constraint errors as fatal, false
  +      *         otherwise.
  +      *
  +      * @see #setValidationContraintFatal
  +      */
  +    bool getValidationConstraintFatal() const;
       //@}
   
   
  @@ -299,16 +348,37 @@
       /**
         * This method allows users to set the validation scheme to be used
         * by this parser. The value is one of the ValSchemes enumerated values
  -      * defined by this class.
  +      * defined by this class:
  +      *
  +      * <br>  Val_Never  - turn off validation
  +      * <br>  Val_Always - turn on validation
  +      * <br>  Val_Auto   - turn on validation if any internal/external
  +      *                  DTD subset have been seen
         *
         * <p>The parser's default state is: Val_Auto.</p>
         *
  -      * @param newState The new validation scheme to use.
  +      * @param newScheme The new validation scheme to use.
         *
         * @see #getValidationScheme
         */
       void setValidationScheme(const ValSchemes newScheme);
   
  +    /** Set the 'schema support' flag
  +      *
  +      * This method allows users to enable or disable the parser's
  +      * schema processing. When set to false, parser will not process
  +      * any schema found.
  +      *
  +      * The parser's default state is: true.
  +      *
  +      * @param newState The value specifying whether schema support should
  +      *                 be enforced or not.
  +      *
  +      * @see #getDoSchema
  +      */
  +    void setDoSchema(const bool newState);
  +
  +
       /**
         * This method allows users to set the parser's behaviour when it
         * encounters the first fatal error. If set to true, the parser
  @@ -325,6 +395,23 @@
         * @see #getExitOnFirstFatalError
         */
       void setExitOnFirstFatalError(const bool newState);
  +
  +    /**
  +      * This method allows users to set the parser's behaviour when it
  +      * encounters a validtion constraint error. If set to true, and the
  +      * the parser is set to exit when it encounter the first fatal error,
  +      * the parser will exit at the first encounter. If false, then it will
  +      * report the error and continue processing.
  +      *
  +      * <p>The default value is 'false'.</p>
  +      *
  +      * @param newState The value specifying whether the parser should
  +      *                 continue or exit when it encounters a validation
  +      *                 constraint error.
  +      *
  +      * @see #getValidationConstraintFatal
  +      */
  +    void setValidationConstraintFatal(const bool newState);
       //@}
   
   
  @@ -374,13 +461,13 @@
         *
         * @param source A const reference to the InputSource object which
         *               points to the XML file to be parsed.
  -      * @param reuseValidator The flag indicating whether the existing
  -      *                       validator should be reused or not for this
  -      *                       parsing run.
  +      * @param reuseGrammar The flag indicating whether the existing Grammar
  +      *                     should be reused or not for this parsing run.
  +      *                     If true, there cannot be any internal subset.
         *
         * @see Parser#parse(InputSource)
         */
  -    virtual void parse(const InputSource& source, const bool reuseValidator = false);
  +    virtual void parse(const InputSource& source, const bool reuseGrammar = false);
   
       /**
         * This method invokes the parsing process on the XML file specified by
  @@ -388,13 +475,13 @@
         *
         * @param systemId A const XMLCh pointer to the Unicode string which
         *                 contains the path to the XML file to be parsed.
  -      * @param reuseValidator The flag indicating whether the existing
  -      *                       validator should be reused or not for this
  -      *                       parsing run.
  +      * @param reuseGrammar The flag indicating whether the existing Grammar
  +      *                     should be reused or not for this parsing run.
  +      *                     If true, there cannot be any internal subset.
         *
         * @see Parser#parse(XMLCh*)
         */
  -//    virtual void parse(const XMLCh* /*const*/ systemId, const bool reuseValidator = false);
  +    virtual void parse(const XMLCh* /*const*/ systemId, const bool reuseGrammar = false);
   
       /**
         * This method invokes the parsing process on the XML file specified by
  @@ -402,11 +489,11 @@
         *
         * @param systemId A const char pointer to a native string which
         *                 contains the path to the XML file to be parsed.
  -      * @param reuseValidator The flag indicating whether the existing
  -      *                       validator should be reused or not for this
  -      *                       parsing run.
  +      * @param reuseGrammar The flag indicating whether the existing Grammar
  +      *                     should be reused or not for this parsing run.
  +      *                     If true, there cannot be any internal subset.
         */
  -//    virtual void parse(const char* /*const*/ systemId, const bool reuseValidator = false);
  +    virtual void parse(const char* /*const*/ systemId, const bool reuseGrammar = false);
   
       /**
         * This method installs the user specified SAX Document Handler
  @@ -482,10 +569,9 @@
         * @param toFill   A token maintaing state information to maintain
         *                 internal consistency between invocation of 'parseNext'
         *                 calls.
  -      * @param reuseValidator The flag indicating whether the existing
  -      *                 validator
  -      *                 should be reused or not for this parsing
  -      *                  run.
  +      * @param reuseGrammar The flag indicating whether the existing Grammar
  +      *                     should be reused or not for this parsing run.
  +      *                     If true, there cannot be any internal subset.
         *
         * @return 'true', if successful in parsing the prolog. It indicates the
         *         user can go ahead with parsing the rest of the file. It
  @@ -496,12 +582,12 @@
         * @see #parseFirst(char*,...)
         * @see #parseFirst(InputSource&,...)
         */
  -//     bool parseFirst
  -//     (
  -// 	   const   XMLCh* /*const*/    systemId
  -// 	   ,       XMLPScanToken&  toFill
  -// 	   , const bool            reuseValidator = false
  -//     );
  +    bool parseFirst
  +    (
  +        const   XMLCh* /*const*/    systemId
  +        ,       XMLPScanToken&  toFill
  +        , const bool            reuseGrammar = false
  +    );
   
       /** Begin a progressive parse operation
         *
  @@ -520,9 +606,9 @@
         * @param toFill   A token maintaing state information to maintain
         *                 internal consIstency between invocation of 'parseNext'
         *                 calls.
  -      * @param reuseValidator The flag indicating whether the existing
  -      *                 validator should be reused or not for this parsing
  -      *                       run.
  +      * @param reuseGrammar The flag indicating whether the existing Grammar
  +      *                     should be reused or not for this parsing run.
  +      *                     If true, there cannot be any internal subset.
         *
         * @return 'true', if successful in parsing the prolog. It indicates the
         *         user can go ahead with parsing the rest of the file. It
  @@ -533,12 +619,12 @@
         * @see #parseFirst(XMLCh*,...)
         * @see #parseFirst(InputSource&,...)
         */
  -//     bool parseFirst
  -//     (
  -// 	   const   char* /*const*/     systemId
  -// 	   ,       XMLPScanToken&  toFill
  -// 	   , const bool            reuseValidator = false
  -//     );
  +    bool parseFirst
  +    (
  +        const   char* /*const*/     systemId
  +        ,       XMLPScanToken&  toFill
  +        , const bool            reuseGrammar = false
  +    );
   
       /** Begin a progressive parse operation
         *
  @@ -557,9 +643,9 @@
         * @param toFill   A token maintaing state information to maintain
         *                 internal consistency between invocation of 'parseNext'
         *                 calls.
  -      * @param reuseValidator The flag indicating whether the existing
  -      *                 validator should be reused or not for this parsing
  -      *                 process.
  +      * @param reuseGrammar The flag indicating whether the existing Grammar
  +      *                     should be reused or not for this parsing run.
  +      *                     If true, there cannot be any internal subset.
         *
         * @return 'true', if successful in parsing the prolog. It indicates the
         *         user can go ahead with parsing the rest of the file. It
  @@ -574,7 +660,7 @@
       (
           const   InputSource&    source
           ,       XMLPScanToken&  toFill
  -        , const bool            reuseValidator = false
  +        , const bool            reuseGrammar = false
       );
   
       /** Continue a progressive parse operation
  
  
  
  1.4       +56 -11    xml-xerces/perl/Xerces_headers/sax2/SAX2XMLReader.hpp
  
  Index: SAX2XMLReader.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/Xerces_headers/sax2/SAX2XMLReader.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SAX2XMLReader.hpp	2001/05/05 23:07:32	1.3
  +++ SAX2XMLReader.hpp	2001/07/09 23:14:23	1.4
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  + * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -56,17 +56,19 @@
   
   /*
    * $Log: SAX2XMLReader.hpp,v $
  - * Revision 1.3  2001/05/05 23:07:32  jasons
  - * uncommented public destructors
  - *
  - * Revision 1.2  2001/04/16 17:56:05  jasons
  + * Revision 1.4  2001/07/09 23:14:23  jasons
    * 	* Xerces_headers/sax2/SAX2XMLReader.hpp (Repository):
  - * 	If you don't want SWIG to create new() comment out the
  - * 	   constructor!!!
  + * 	* Xerces_headers/parsers/SAXParser.hpp (Repository):
  + * 	Updated for schemas
    *
  - * Revision 1.1  2001/04/13 22:27:55  jasons
  - * 	* Xerces_headers/sax2/SAX2XMLReader.hpp (Repository):
  - * 	Another SAX API that needs to get supported.
  + * Revision 1.9  2001/06/19 16:44:31  tng
  + * Add installAdvDocHandler to SAX2XMLReader as the code is there already.
  + *
  + * Revision 1.8  2001/06/04 21:03:07  jberry
  + * Add pure virtual getErrorCount to SAX2XMLReader interface.
  + *
  + * Revision 1.7  2001/05/11 13:26:25  tng
  + * Copyright update.
    *
    * Revision 1.6  2001/02/15 15:56:31  tng
    * Schema: Add setSchemaValidation and getSchemaValidation for DOMParser and SAXParser.
  @@ -149,6 +151,18 @@
       /** @name The XMLReader interfaces */
       //@{
   
  +    /** Get error count from the last parse operation.
  +      *
  +      * This method returns the error count from the last parse
  +      * operation. Note that this count is actually stored in the
  +      * scanner, so this method simply returns what the
  +      * scanner reports.
  +      *
  +      * @return number of errors encountered during the latest
  +      *			parse operation.
  +      */
  +    virtual int getErrorCount() const = 0 ;
  +
       /**
         * This method returns the installed content handler.
         *
  @@ -158,7 +172,7 @@
   
       /**
         * This method returns the installed DTD handler.
  -
  +      *
         * @return A pointer to the installed DTD handler object.
         */
       virtual DTDHandler* getDTDHandler() const ;
  @@ -431,7 +445,40 @@
   	  * the object returned.
   	  *
   	  */
  -	virtual XMLValidator* getValidator() const ;
  +	virtual XMLValidator* getValidator() const;
  +    //@}
  +
  +    // -----------------------------------------------------------------------
  +    //  Advanced document handler list maintenance methods
  +    // -----------------------------------------------------------------------
  +
  +    /** @name Advanced document handler list maintenance methods */
  +    //@{
  +    /**
  +      * This method installs the specified 'advanced' document callback
  +      * handler, thereby allowing the user to customize the processing,
  +      * if they choose to do so. Any number of advanced callback handlers
  +      * maybe installed.
  +      *
  +      * <p>The methods in the advanced callback interface represent
  +      * Xerces-C extensions. There is no specification for this interface.</p>
  +      *
  +      * @param toInstall A pointer to the users advanced callback handler.
  +      *
  +      * @see #removeAdvDocHandler
  +      */
  +    virtual void installAdvDocHandler(XMLDocumentHandler* /*const*/ toInstall) = 0;
  +
  +    /**
  +      * This method removes the 'advanced' document handler callback from
  +      * the underlying parser scanner. If no handler is installed, advanced
  +      * callbacks are not invoked by the scanner.
  +      * @param toRemove A pointer to the advanced callback handler which
  +      *                 should be removed.
  +      *
  +      * @see #installAdvDocHandler
  +      */
  +    virtual bool removeAdvDocHandler(XMLDocumentHandler* /*const*/ toRemove) = 0;
       //@}
   
   // private :
  
  
  

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