http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Release Info

Installation
Download
Build

FAQs
Samples
API Docs

DOM C++ Binding
Programming
Migration Guide

Feedback
Bug-Reporting
PDF Document

CVS Repository
Mail Archive

API Docs for SAX and DOM
 

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DefaultHandler.hpp

Go to the documentation of this file.
00001 /*
00002  * The Apache Software License, Version 1.1
00003  *
00004  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
00005  * reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  *
00014  * 2. Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in
00016  *    the documentation and/or other materials provided with the
00017  *    distribution.
00018  *
00019  * 3. The end-user documentation included with the redistribution,
00020  *    if any, must include the following acknowledgment:
00021  *       "This product includes software developed by the
00022  *        Apache Software Foundation (http://www.apache.org/)."
00023  *    Alternately, this acknowledgment may appear in the software itself,
00024  *    if and wherever such third-party acknowledgments normally appear.
00025  *
00026  * 4. The names "Xerces" and "Apache Software Foundation" must
00027  *    not be used to endorse or promote products derived from this
00028  *    software without prior written permission. For written
00029  *    permission, please contact apache\@apache.org.
00030  *
00031  * 5. Products derived from this software may not be called "Apache",
00032  *    nor may "Apache" appear in their name, without prior written
00033  *    permission of the Apache Software Foundation.
00034  *
00035  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00036  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00037  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00038  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00039  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00040  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00041  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00042  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00043  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00044  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00045  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00046  * SUCH DAMAGE.
00047  * ====================================================================
00048  *
00049  * This software consists of voluntary contributions made by many
00050  * individuals on behalf of the Apache Software Foundation, and was
00051  * originally based on software copyright (c) 1999, International
00052  * Business Machines, Inc., http://www.ibm.com .  For more information
00053  * on the Apache Software Foundation, please see
00054  * <http://www.apache.org/>.
00055  */
00056 
00057 /*
00058  * $Log: DefaultHandler.hpp,v $
00059  * Revision 1.3  2002/06/06 20:38:45  tng
00060  * Document Fix: document that the returned object from resolveEntity is owned by the parser
00061  *
00062  * Revision 1.2  2002/02/20 18:17:02  tng
00063  * [Bug 5977] Warnings on generating apiDocs.
00064  *
00065  * Revision 1.1.1.1  2002/02/01 22:22:09  peiyongz
00066  * sane_include
00067  *
00068  * Revision 1.6  2002/01/28 17:08:33  knoaman
00069  * SAX2-ext's DeclHandler support.
00070  *
00071  * Revision 1.5  2001/11/13 13:24:05  tng
00072  * Fix documentation for DefaultHandler.
00073  *
00074  * Revision 1.4  2000/12/22 15:17:01  tng
00075  * SAX2-ext's LexicalHandler support added by David Bertoni.
00076  *
00077  * Revision 1.3  2000/08/14 18:56:14  aruna1
00078  * Virtual parameter inconsistency fixed
00079  *
00080  * Revision 1.2  2000/08/07 18:21:27  jpolast
00081  * change  module to 
00082  *
00083  * Revision 1.1  2000/08/02 18:02:34  jpolast
00084  * initial checkin of sax2 implementation
00085  * submitted by Simon Fell (simon@fell.com)
00086  * and Joe Polastre (jpolast@apache.org)
00087  *
00088  *
00089  */
00090 
00091 
00092 #ifndef DEFAULTHANDLER_HPP
00093 #define DEFAULTHANDLER_HPP
00094 
00095 #include <xercesc/sax2/ContentHandler.hpp>
00096 #include <xercesc/sax2/LexicalHandler.hpp>
00097 #include <xercesc/sax2/DeclHandler.hpp>
00098 #include <xercesc/sax/DTDHandler.hpp>
00099 #include <xercesc/sax/EntityResolver.hpp>
00100 #include <xercesc/sax/ErrorHandler.hpp>
00101 #include <xercesc/sax/SAXParseException.hpp>
00102 
00103 class Locator;
00104 class Attributes;
00105 
00127 
00128 class  DefaultHandler :
00129 
00130     public EntityResolver,
00131     public DTDHandler,
00132     public ContentHandler,
00133     public ErrorHandler,
00134     public LexicalHandler,
00135     public DeclHandler
00136 {
00137 public:
00140 
00155     virtual void characters
00156     (
00157         const   XMLCh* const    chars
00158         , const unsigned int    length
00159     );
00160 
00173     virtual void endDocument();
00174 
00190     virtual void endElement
00191     (
00192         const XMLCh* const uri,
00193         const XMLCh* const localname,
00194         const XMLCh* const qname
00195     );
00196 
00212     virtual void ignorableWhitespace
00213     (
00214         const   XMLCh* const    chars
00215         , const unsigned int    length
00216     );
00217 
00233     virtual void processingInstruction
00234     (
00235         const   XMLCh* const    target
00236         , const XMLCh* const    data
00237     );
00238 
00244     virtual void resetDocument();
00246 
00248 
00250 
00261     virtual void setDocumentLocator(const Locator* const locator);
00262 
00275     virtual void startDocument();
00276 
00293     virtual void startElement
00294     (
00295         const   XMLCh* const    uri,
00296         const   XMLCh* const    localname,
00297         const   XMLCh* const    qname
00298         , const Attributes& attrs
00299     );
00300 
00316     virtual void startPrefixMapping
00317     (
00318         const   XMLCh* const    prefix,
00319         const   XMLCh* const    uri
00320     ) ;
00321 
00336     virtual void endPrefixMapping
00337     (
00338         const   XMLCh* const    prefix
00339     ) ;
00340 
00358     virtual void skippedEntity
00359     (
00360         const   XMLCh* const    name
00361     ) ;
00362 
00364 
00366 
00368 
00389     virtual InputSource* resolveEntity
00390     (
00391         const   XMLCh* const    publicId
00392         , const XMLCh* const    systemId
00393     );
00394 
00396 
00399 
00413     virtual void error(const SAXParseException& exception);
00414 
00432     virtual void fatalError(const SAXParseException& exception);
00433 
00448     virtual void warning(const SAXParseException& exception);
00449 
00455     virtual void resetErrors();
00456 
00458 
00459 
00462 
00476     virtual void notationDecl
00477     (
00478         const   XMLCh* const    name
00479         , const XMLCh* const    publicId
00480         , const XMLCh* const    systemId
00481     );
00482 
00488     virtual void resetDocType();
00489 
00504     virtual void unparsedEntityDecl
00505     (
00506         const   XMLCh* const    name
00507         , const XMLCh* const    publicId
00508         , const XMLCh* const    systemId
00509         , const XMLCh* const    notationName
00510     );
00512 
00513 
00515 
00517 
00531     virtual void comment
00532     (
00533         const   XMLCh* const    chars
00534         , const unsigned int    length
00535     );
00536 
00546     virtual void endCDATA ();
00547 
00557     virtual void endDTD ();
00558 
00569     virtual void endEntity (const XMLCh* const name);
00570 
00580     virtual void startCDATA ();
00581 
00594     virtual void startDTD
00595     (
00596         const   XMLCh* const    name
00597         , const   XMLCh* const    publicId
00598         , const   XMLCh* const    systemId
00599     );
00600 
00611     virtual void startEntity (const XMLCh* const name);
00612 
00614 
00616 
00618 
00635     virtual void elementDecl
00636     (
00637         const   XMLCh* const    name
00638         , const XMLCh* const    model
00639     );
00640 
00655     virtual void attributeDecl
00656     (
00657         const   XMLCh* const    eName
00658         , const XMLCh* const    aName
00659         , const XMLCh* const    type
00660         , const XMLCh* const    mode
00661         , const XMLCh* const    value
00662     );
00663 
00676     virtual void internalEntityDecl
00677     (
00678         const   XMLCh* const    name
00679         , const XMLCh* const    value
00680     );
00681 
00694     virtual void externalEntityDecl
00695     (
00696         const   XMLCh* const    name
00697         , const XMLCh* const    publicId
00698         , const XMLCh* const    systemId
00699     );
00700 
00702 };
00703 
00704 
00705 // ---------------------------------------------------------------------------
00706 //  HandlerBase: Inline default implementations
00707 // ---------------------------------------------------------------------------
00708 inline void DefaultHandler::characters(const   XMLCh* const    chars
00709                                        ,const   unsigned int    length)
00710 {
00711 }
00712 
00713 inline void DefaultHandler::endDocument()
00714 {
00715 }
00716 
00717 inline void DefaultHandler::endElement(const    XMLCh* const uri
00718                                         , const XMLCh* const localname
00719                                         , const XMLCh* const qname)
00720 {
00721 }
00722 
00723 inline void DefaultHandler::error(const SAXParseException& exception)
00724 {
00725 }
00726 
00727 inline void DefaultHandler::fatalError(const SAXParseException& exception)
00728 {
00729     throw exception;
00730 }
00731 
00732 inline void
00733 DefaultHandler::ignorableWhitespace( const   XMLCh* const   chars
00734                                     , const unsigned int    length)
00735 {
00736 }
00737 
00738 inline void DefaultHandler::notationDecl(  const   XMLCh* const name
00739                                             , const XMLCh* const publicId
00740                                             , const XMLCh* const systemId)
00741 {
00742 }
00743 
00744 inline void
00745 DefaultHandler::processingInstruction( const   XMLCh* const target
00746                                         , const XMLCh* const data)
00747 {
00748 }
00749 
00750 inline void DefaultHandler::resetErrors()
00751 {
00752 }
00753 
00754 inline void DefaultHandler::resetDocument()
00755 {
00756 }
00757 
00758 inline void DefaultHandler::resetDocType()
00759 {
00760 }
00761 
00762 inline InputSource*
00763 DefaultHandler::resolveEntity( const   XMLCh* const publicId
00764                                 , const XMLCh* const systemId)
00765 {
00766     return 0;
00767 }
00768 
00769 inline void
00770 DefaultHandler::unparsedEntityDecl(const   XMLCh* const name
00771                                     , const XMLCh* const publicId
00772                                     , const XMLCh* const systemId
00773                                     , const XMLCh* const notationName)
00774 {
00775 }
00776 
00777 inline void DefaultHandler::setDocumentLocator(const Locator* const locator)
00778 {
00779 }
00780 
00781 inline void DefaultHandler::startDocument()
00782 {
00783 }
00784 
00785 inline void
00786 DefaultHandler::startElement(  const     XMLCh* const  uri
00787                                 , const   XMLCh* const  localname
00788                                 , const   XMLCh* const  qname
00789                                 , const   Attributes&       attrs
00790 )
00791 {
00792 }
00793 
00794 inline void DefaultHandler::warning(const SAXParseException& exception)
00795 {
00796 }
00797 
00798 inline void DefaultHandler::startPrefixMapping ( const  XMLCh* const    prefix
00799                                                 ,const  XMLCh* const    uri)
00800 {
00801 }
00802 
00803 inline void DefaultHandler::endPrefixMapping ( const    XMLCh* const    prefix )
00804 {
00805 }
00806 
00807 inline void DefaultHandler::skippedEntity ( const   XMLCh* const    name )
00808 {
00809 }
00810 
00811 inline void DefaultHandler::comment(  const   XMLCh* const    chars
00812                                        , const unsigned int    length)
00813 {
00814 }
00815 
00816 inline void DefaultHandler::endCDATA ()
00817 {
00818 }
00819 
00820 inline void DefaultHandler::endDTD ()
00821 {
00822 }
00823 
00824 inline void DefaultHandler::endEntity (const XMLCh* const name)
00825 {
00826 }
00827 
00828 inline void DefaultHandler::startCDATA ()
00829 {
00830 }
00831 
00832 inline void DefaultHandler::startDTD(  const   XMLCh* const    name
00833                                         , const   XMLCh* const publicId
00834                                         , const   XMLCh* const systemId)
00835 {
00836 }
00837 
00838 inline void DefaultHandler::startEntity (const XMLCh* const name)
00839 {
00840 }
00841 
00842 inline void DefaultHandler::attributeDecl(const XMLCh* const,
00843                                           const XMLCh* const,
00844                                           const XMLCh* const,
00845                                           const XMLCh* const,
00846                                           const XMLCh* const)
00847 {
00848 }
00849 
00850 inline void DefaultHandler::elementDecl(const XMLCh* const,
00851                                         const XMLCh* const)
00852 {
00853 }
00854 
00855 inline void DefaultHandler::externalEntityDecl(const XMLCh* const,
00856                                                const XMLCh* const,
00857                                                const XMLCh* const)
00858 {
00859 }
00860 
00861 inline void DefaultHandler::internalEntityDecl(const XMLCh* const,
00862                                                const XMLCh* const)
00863 {
00864 }
00865 
00866 #endif // ! DEFAULTHANDLER_HPP


Copyright © 2000 The Apache Software Foundation. All Rights Reserved.