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.6  2003/12/02 14:33:13  amassari
00060  * Don't use the word "exception" as a variable name, as VC 7.1 complains about it
00061  *
00062  * Revision 1.5  2002/11/04 14:55:45  tng
00063  * C++ Namespace Support.
00064  *
00065  * Revision 1.4  2002/08/20 16:53:56  tng
00066  * [Bug 6251] Info during compilation.
00067  *
00068  * Revision 1.3  2002/06/06 20:38:45  tng
00069  * Document Fix: document that the returned object from resolveEntity is owned by the parser
00070  *
00071  * Revision 1.2  2002/02/20 18:17:02  tng
00072  * [Bug 5977] Warnings on generating apiDocs.
00073  *
00074  * Revision 1.1.1.1  2002/02/01 22:22:09  peiyongz
00075  * sane_include
00076  *
00077  * Revision 1.6  2002/01/28 17:08:33  knoaman
00078  * SAX2-ext's DeclHandler support.
00079  *
00080  * Revision 1.5  2001/11/13 13:24:05  tng
00081  * Fix documentation for DefaultHandler.
00082  *
00083  * Revision 1.4  2000/12/22 15:17:01  tng
00084  * SAX2-ext's LexicalHandler support added by David Bertoni.
00085  *
00086  * Revision 1.3  2000/08/14 18:56:14  aruna1
00087  * Virtual parameter inconsistency fixed
00088  *
00089  * Revision 1.2  2000/08/07 18:21:27  jpolast
00090  * change  module to 
00091  *
00092  * Revision 1.1  2000/08/02 18:02:34  jpolast
00093  * initial checkin of sax2 implementation
00094  * submitted by Simon Fell (simon@fell.com)
00095  * and Joe Polastre (jpolast@apache.org)
00096  *
00097  *
00098  */
00099 
00100 
00101 #ifndef DEFAULTHANDLER_HPP
00102 #define DEFAULTHANDLER_HPP
00103 
00104 #include <xercesc/sax2/ContentHandler.hpp>
00105 #include <xercesc/sax2/LexicalHandler.hpp>
00106 #include <xercesc/sax2/DeclHandler.hpp>
00107 #include <xercesc/sax/DTDHandler.hpp>
00108 #include <xercesc/sax/EntityResolver.hpp>
00109 #include <xercesc/sax/ErrorHandler.hpp>
00110 #include <xercesc/sax/SAXParseException.hpp>
00111 
00112 XERCES_CPP_NAMESPACE_BEGIN
00113 
00114 class Locator;
00115 class Attributes;
00116 
00139 class  DefaultHandler :
00140 
00141     public EntityResolver,
00142     public DTDHandler,
00143     public ContentHandler,
00144     public ErrorHandler,
00145     public LexicalHandler,
00146     public DeclHandler
00147 {
00148 public:
00166     virtual void characters
00167     (
00168         const   XMLCh* const    chars
00169         , const unsigned int    length
00170     );
00171 
00184     virtual void endDocument();
00185 
00201     virtual void endElement
00202     (
00203         const XMLCh* const uri,
00204         const XMLCh* const localname,
00205         const XMLCh* const qname
00206     );
00207 
00223     virtual void ignorableWhitespace
00224     (
00225         const   XMLCh* const    chars
00226         , const unsigned int    length
00227     );
00228 
00244     virtual void processingInstruction
00245     (
00246         const   XMLCh* const    target
00247         , const XMLCh* const    data
00248     );
00249 
00255     virtual void resetDocument();
00257 
00272     virtual void setDocumentLocator(const Locator* const locator);
00273 
00286     virtual void startDocument();
00287 
00304     virtual void startElement
00305     (
00306         const   XMLCh* const    uri,
00307         const   XMLCh* const    localname,
00308         const   XMLCh* const    qname
00309         , const Attributes& attrs
00310     );
00311 
00327     virtual void startPrefixMapping
00328     (
00329         const   XMLCh* const    prefix,
00330         const   XMLCh* const    uri
00331     ) ;
00332 
00347     virtual void endPrefixMapping
00348     (
00349         const   XMLCh* const    prefix
00350     ) ;
00351 
00369     virtual void skippedEntity
00370     (
00371         const   XMLCh* const    name
00372     ) ;
00373 
00375 
00400     virtual InputSource* resolveEntity
00401     (
00402         const   XMLCh* const    publicId
00403         , const XMLCh* const    systemId
00404     );
00405 
00407 
00424     virtual void error(const SAXParseException& exc);
00425 
00443     virtual void fatalError(const SAXParseException& exc);
00444 
00459     virtual void warning(const SAXParseException& exc);
00460 
00466     virtual void resetErrors();
00467 
00469 
00470 
00473 
00487     virtual void notationDecl
00488     (
00489         const   XMLCh* const    name
00490         , const XMLCh* const    publicId
00491         , const XMLCh* const    systemId
00492     );
00493 
00499     virtual void resetDocType();
00500 
00515     virtual void unparsedEntityDecl
00516     (
00517         const   XMLCh* const    name
00518         , const XMLCh* const    publicId
00519         , const XMLCh* const    systemId
00520         , const XMLCh* const    notationName
00521     );
00523 
00524 
00542     virtual void comment
00543     (
00544         const   XMLCh* const    chars
00545         , const unsigned int    length
00546     );
00547 
00557     virtual void endCDATA ();
00558 
00568     virtual void endDTD ();
00569 
00580     virtual void endEntity (const XMLCh* const name);
00581 
00591     virtual void startCDATA ();
00592 
00605     virtual void startDTD
00606     (
00607         const   XMLCh* const    name
00608         , const   XMLCh* const    publicId
00609         , const   XMLCh* const    systemId
00610     );
00611 
00622     virtual void startEntity (const XMLCh* const name);
00623 
00625 
00629 
00646     virtual void elementDecl
00647     (
00648         const   XMLCh* const    name
00649         , const XMLCh* const    model
00650     );
00651 
00666     virtual void attributeDecl
00667     (
00668         const   XMLCh* const    eName
00669         , const XMLCh* const    aName
00670         , const XMLCh* const    type
00671         , const XMLCh* const    mode
00672         , const XMLCh* const    value
00673     );
00674 
00687     virtual void internalEntityDecl
00688     (
00689         const   XMLCh* const    name
00690         , const XMLCh* const    value
00691     );
00692 
00705     virtual void externalEntityDecl
00706     (
00707         const   XMLCh* const    name
00708         , const XMLCh* const    publicId
00709         , const XMLCh* const    systemId
00710     );
00711 
00713 };
00714 
00715 
00716 // ---------------------------------------------------------------------------
00717 //  HandlerBase: Inline default implementations
00718 // ---------------------------------------------------------------------------
00719 inline void DefaultHandler::characters(const   XMLCh* const
00720                                        ,const   unsigned int)
00721 {
00722 }
00723 
00724 inline void DefaultHandler::endDocument()
00725 {
00726 }
00727 
00728 inline void DefaultHandler::endElement(const    XMLCh* const
00729                                         , const XMLCh* const
00730                                         , const XMLCh* const)
00731 {
00732 }
00733 
00734 inline void DefaultHandler::error(const SAXParseException&)
00735 {
00736 }
00737 
00738 inline void DefaultHandler::fatalError(const SAXParseException& exc)
00739 {
00740     throw exc;
00741 }
00742 
00743 inline void
00744 DefaultHandler::ignorableWhitespace( const   XMLCh* const
00745                                     , const unsigned int)
00746 {
00747 }
00748 
00749 inline void DefaultHandler::notationDecl(  const   XMLCh* const
00750                                             , const XMLCh* const
00751                                             , const XMLCh* const)
00752 {
00753 }
00754 
00755 inline void
00756 DefaultHandler::processingInstruction( const   XMLCh* const
00757                                         , const XMLCh* const)
00758 {
00759 }
00760 
00761 inline void DefaultHandler::resetErrors()
00762 {
00763 }
00764 
00765 inline void DefaultHandler::resetDocument()
00766 {
00767 }
00768 
00769 inline void DefaultHandler::resetDocType()
00770 {
00771 }
00772 
00773 inline InputSource*
00774 DefaultHandler::resolveEntity( const   XMLCh* const
00775                                 , const XMLCh* const)
00776 {
00777     return 0;
00778 }
00779 
00780 inline void
00781 DefaultHandler::unparsedEntityDecl(const   XMLCh* const
00782                                     , const XMLCh* const
00783                                     , const XMLCh* const
00784                                     , const XMLCh* const)
00785 {
00786 }
00787 
00788 inline void DefaultHandler::setDocumentLocator(const Locator* const)
00789 {
00790 }
00791 
00792 inline void DefaultHandler::startDocument()
00793 {
00794 }
00795 
00796 inline void
00797 DefaultHandler::startElement(  const     XMLCh* const
00798                                 , const   XMLCh* const
00799                                 , const   XMLCh* const
00800                                 , const   Attributes&
00801 )
00802 {
00803 }
00804 
00805 inline void DefaultHandler::warning(const SAXParseException&)
00806 {
00807 }
00808 
00809 inline void DefaultHandler::startPrefixMapping ( const  XMLCh* const
00810                                                 ,const  XMLCh* const)
00811 {
00812 }
00813 
00814 inline void DefaultHandler::endPrefixMapping ( const    XMLCh* const)
00815 {
00816 }
00817 
00818 inline void DefaultHandler::skippedEntity ( const   XMLCh* const)
00819 {
00820 }
00821 
00822 inline void DefaultHandler::comment(  const   XMLCh* const
00823                                        , const unsigned int)
00824 {
00825 }
00826 
00827 inline void DefaultHandler::endCDATA ()
00828 {
00829 }
00830 
00831 inline void DefaultHandler::endDTD ()
00832 {
00833 }
00834 
00835 inline void DefaultHandler::endEntity (const XMLCh* const)
00836 {
00837 }
00838 
00839 inline void DefaultHandler::startCDATA ()
00840 {
00841 }
00842 
00843 inline void DefaultHandler::startDTD(  const   XMLCh* const
00844                                         , const   XMLCh* const
00845                                         , const   XMLCh* const)
00846 {
00847 }
00848 
00849 inline void DefaultHandler::startEntity (const XMLCh* const)
00850 {
00851 }
00852 
00853 inline void DefaultHandler::attributeDecl(const XMLCh* const,
00854                                           const XMLCh* const,
00855                                           const XMLCh* const,
00856                                           const XMLCh* const,
00857                                           const XMLCh* const)
00858 {
00859 }
00860 
00861 inline void DefaultHandler::elementDecl(const XMLCh* const,
00862                                         const XMLCh* const)
00863 {
00864 }
00865 
00866 inline void DefaultHandler::externalEntityDecl(const XMLCh* const,
00867                                                const XMLCh* const,
00868                                                const XMLCh* const)
00869 {
00870 }
00871 
00872 inline void DefaultHandler::internalEntityDecl(const XMLCh* const,
00873                                                const XMLCh* const)
00874 {
00875 }
00876 
00877 XERCES_CPP_NAMESPACE_END
00878 
00879 #endif // ! DEFAULTHANDLER_HPP


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