[188] | 1 | /*
|
---|
| 2 | * The Apache Software License, Version 1.1
|
---|
| 3 | *
|
---|
| 4 | * Copyright (c) 1999-2000 The Apache Software Foundation. All rights
|
---|
| 5 | * reserved.
|
---|
| 6 | *
|
---|
| 7 | * Redistribution and use in source and binary forms, with or without
|
---|
| 8 | * modification, are permitted provided that the following conditions
|
---|
| 9 | * are met:
|
---|
| 10 | *
|
---|
| 11 | * 1. Redistributions of source code must retain the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer.
|
---|
| 13 | *
|
---|
| 14 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
| 15 | * notice, this list of conditions and the following disclaimer in
|
---|
| 16 | * the documentation and/or other materials provided with the
|
---|
| 17 | * distribution.
|
---|
| 18 | *
|
---|
| 19 | * 3. The end-user documentation included with the redistribution,
|
---|
| 20 | * if any, must include the following acknowledgment:
|
---|
| 21 | * "This product includes software developed by the
|
---|
| 22 | * Apache Software Foundation (http://www.apache.org/)."
|
---|
| 23 | * Alternately, this acknowledgment may appear in the software itself,
|
---|
| 24 | * if and wherever such third-party acknowledgments normally appear.
|
---|
| 25 | *
|
---|
| 26 | * 4. The names "Xerces" and "Apache Software Foundation" must
|
---|
| 27 | * not be used to endorse or promote products derived from this
|
---|
| 28 | * software without prior written permission. For written
|
---|
| 29 | * permission, please contact apache\@apache.org.
|
---|
| 30 | *
|
---|
| 31 | * 5. Products derived from this software may not be called "Apache",
|
---|
| 32 | * nor may "Apache" appear in their name, without prior written
|
---|
| 33 | * permission of the Apache Software Foundation.
|
---|
| 34 | *
|
---|
| 35 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
---|
| 36 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 37 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
---|
| 38 | * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
---|
| 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
---|
| 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
---|
| 41 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
---|
| 42 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
| 43 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
---|
| 44 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
---|
| 45 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
| 46 | * SUCH DAMAGE.
|
---|
| 47 | * ====================================================================
|
---|
| 48 | *
|
---|
| 49 | * This software consists of voluntary contributions made by many
|
---|
| 50 | * individuals on behalf of the Apache Software Foundation, and was
|
---|
| 51 | * originally based on software copyright (c) 1999, International
|
---|
| 52 | * Business Machines, Inc., http://www.ibm.com . For more information
|
---|
| 53 | * on the Apache Software Foundation, please see
|
---|
| 54 | * <http://www.apache.org/>.
|
---|
| 55 | */
|
---|
| 56 |
|
---|
| 57 | /*
|
---|
| 58 | * $Log: DTDHandler.hpp,v $
|
---|
| 59 | * Revision 1.4 2003/03/07 18:10:06 tng
|
---|
| 60 | * Return a reference instead of void for operator=
|
---|
| 61 | *
|
---|
| 62 | * Revision 1.3 2002/11/04 14:56:25 tng
|
---|
| 63 | * C++ Namespace Support.
|
---|
| 64 | *
|
---|
| 65 | * Revision 1.2 2002/02/20 18:17:01 tng
|
---|
| 66 | * [Bug 5977] Warnings on generating apiDocs.
|
---|
| 67 | *
|
---|
| 68 | * Revision 1.1.1.1 2002/02/01 22:22:08 peiyongz
|
---|
| 69 | * sane_include
|
---|
| 70 | *
|
---|
| 71 | * Revision 1.5 2000/02/24 20:12:54 abagchi
|
---|
| 72 | * Swat for removing Log from API docs
|
---|
| 73 | *
|
---|
| 74 | * Revision 1.4 2000/02/12 03:31:55 rahulj
|
---|
| 75 | * Removed duplicate CVS Log entries.
|
---|
| 76 | *
|
---|
| 77 | * Revision 1.3 2000/02/12 01:27:19 aruna1
|
---|
| 78 | * Documentation updated
|
---|
| 79 | *
|
---|
| 80 | * Revision 1.2 2000/02/06 07:47:57 rahulj
|
---|
| 81 | * Year 2K copyright swat.
|
---|
| 82 | *
|
---|
| 83 | * Revision 1.1.1.1 1999/11/09 01:07:44 twl
|
---|
| 84 | * Initial checkin
|
---|
| 85 | *
|
---|
| 86 | * Revision 1.2 1999/11/08 20:44:54 rahul
|
---|
| 87 | * Swat for adding in Product name and CVS comment log variable.
|
---|
| 88 | *
|
---|
| 89 | */
|
---|
| 90 |
|
---|
| 91 |
|
---|
| 92 | #ifndef DTDHANDLER_HPP
|
---|
| 93 | #define DTDHANDLER_HPP
|
---|
| 94 |
|
---|
| 95 | #include <xercesc/util/XercesDefs.hpp>
|
---|
| 96 |
|
---|
| 97 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
| 98 |
|
---|
| 99 | /**
|
---|
| 100 | * Receive notification of basic DTD-related events.
|
---|
| 101 | *
|
---|
| 102 | * <p>If a SAX application needs information about notations and
|
---|
| 103 | * unparsed entities, then the application implements this
|
---|
| 104 | * interface and registers an instance with the SAX parser using
|
---|
| 105 | * the parser's setDTDHandler method. The parser uses the
|
---|
| 106 | * instance to report notation and unparsed entity declarations to
|
---|
| 107 | * the application.</p>
|
---|
| 108 | *
|
---|
| 109 | * <p>The SAX parser may report these events in any order, regardless
|
---|
| 110 | * of the order in which the notations and unparsed entities were
|
---|
| 111 | * declared; however, all DTD events must be reported after the
|
---|
| 112 | * document handler's startDocument event, and before the first
|
---|
| 113 | * startElement event.</p>
|
---|
| 114 | *
|
---|
| 115 | * <p>It is up to the application to store the information for
|
---|
| 116 | * future use (perhaps in a hash table or object tree).
|
---|
| 117 | * If the application encounters attributes of type "NOTATION",
|
---|
| 118 | * "ENTITY", or "ENTITIES", it can use the information that it
|
---|
| 119 | * obtained through this interface to find the entity and/or
|
---|
| 120 | * notation corresponding with the attribute value.</p>
|
---|
| 121 | *
|
---|
| 122 | * <p>The HandlerBase class provides a default implementation
|
---|
| 123 | * of this interface, which simply ignores the events.</p>
|
---|
| 124 | *
|
---|
| 125 | * @see Parser#setDTDHandler
|
---|
| 126 | * @see HandlerBase#HandlerBase
|
---|
| 127 | */
|
---|
| 128 |
|
---|
| 129 | class SAX_EXPORT DTDHandler
|
---|
| 130 | {
|
---|
| 131 | public:
|
---|
| 132 | /** @name Constructors and Destructor */
|
---|
| 133 | //@{
|
---|
| 134 | /** Default Constructor */
|
---|
| 135 | DTDHandler()
|
---|
| 136 | {
|
---|
| 137 | }
|
---|
| 138 |
|
---|
| 139 | /** Destructor */
|
---|
| 140 | virtual ~DTDHandler()
|
---|
| 141 | {
|
---|
| 142 | }
|
---|
| 143 |
|
---|
| 144 | //@}
|
---|
| 145 |
|
---|
| 146 | /** @name The DTD handler interface */
|
---|
| 147 | //@{
|
---|
| 148 | /**
|
---|
| 149 | * Receive notification of a notation declaration event.
|
---|
| 150 | *
|
---|
| 151 | * <p>It is up to the application to record the notation for later
|
---|
| 152 | * reference, if necessary.</p>
|
---|
| 153 | *
|
---|
| 154 | * <p>If a system identifier is present, and it is a URL, the SAX
|
---|
| 155 | * parser must resolve it fully before passing it to the
|
---|
| 156 | * application.</p>
|
---|
| 157 | *
|
---|
| 158 | * @param name The notation name.
|
---|
| 159 | * @param publicId The notation's public identifier, or null if
|
---|
| 160 | * none was given.
|
---|
| 161 | * @param systemId The notation's system identifier, or null if
|
---|
| 162 | * none was given.
|
---|
| 163 | * @exception SAXException Any SAX exception, possibly
|
---|
| 164 | * wrapping another exception.
|
---|
| 165 | * @see #unparsedEntityDecl
|
---|
| 166 | * @see AttributeList#AttributeList
|
---|
| 167 | */
|
---|
| 168 | virtual void notationDecl
|
---|
| 169 | (
|
---|
| 170 | const XMLCh* const name
|
---|
| 171 | , const XMLCh* const publicId
|
---|
| 172 | , const XMLCh* const systemId
|
---|
| 173 | ) = 0;
|
---|
| 174 |
|
---|
| 175 | /**
|
---|
| 176 | * Receive notification of an unparsed entity declaration event.
|
---|
| 177 | *
|
---|
| 178 | * <p>Note that the notation name corresponds to a notation
|
---|
| 179 | * reported by the notationDecl() event. It is up to the
|
---|
| 180 | * application to record the entity for later reference, if
|
---|
| 181 | * necessary.</p>
|
---|
| 182 | *
|
---|
| 183 | * <p>If the system identifier is a URL, the parser must resolve it
|
---|
| 184 | * fully before passing it to the application.</p>
|
---|
| 185 | *
|
---|
| 186 | * @exception SAXException Any SAX exception, possibly
|
---|
| 187 | * wrapping another exception.
|
---|
| 188 | * @param name The unparsed entity's name.
|
---|
| 189 | * @param publicId The entity's public identifier, or null if none
|
---|
| 190 | * was given.
|
---|
| 191 | * @param systemId The entity's system identifier (it must always
|
---|
| 192 | * have one).
|
---|
| 193 | * @param notationName The name of the associated notation.
|
---|
| 194 | * @see #notationDecl
|
---|
| 195 | * @see AttributeList#AttributeList
|
---|
| 196 | */
|
---|
| 197 | virtual void unparsedEntityDecl
|
---|
| 198 | (
|
---|
| 199 | const XMLCh* const name
|
---|
| 200 | , const XMLCh* const publicId
|
---|
| 201 | , const XMLCh* const systemId
|
---|
| 202 | , const XMLCh* const notationName
|
---|
| 203 | ) = 0;
|
---|
| 204 |
|
---|
| 205 | /**
|
---|
| 206 | * Reset the DocType object on its reuse
|
---|
| 207 | *
|
---|
| 208 | * <p>This method helps in reseting the DTD object implementational
|
---|
| 209 | * defaults each time the DTD is begun.</p>
|
---|
| 210 | *
|
---|
| 211 | */
|
---|
| 212 | virtual void resetDocType() = 0;
|
---|
| 213 |
|
---|
| 214 | //@}
|
---|
| 215 |
|
---|
| 216 | private :
|
---|
| 217 | /* Unimplemented constructors and operators */
|
---|
| 218 |
|
---|
| 219 | /* Copy constructor */
|
---|
| 220 | DTDHandler(const DTDHandler&);
|
---|
| 221 |
|
---|
| 222 | /* Assignment operator */
|
---|
| 223 | DTDHandler& operator=(const DTDHandler&);
|
---|
| 224 |
|
---|
| 225 | };
|
---|
| 226 |
|
---|
| 227 | XERCES_CPP_NAMESPACE_END
|
---|
| 228 |
|
---|
| 229 | #endif
|
---|