source: NonGTP/Xerces/xercesc/sax2/DeclHandler.hpp @ 188

Revision 188, 7.7 KB checked in by mattausch, 19 years ago (diff)

added xercesc to support

Line 
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: DeclHandler.hpp,v $
59 * Revision 1.3  2003/03/07 18:10:30  tng
60 * Return a reference instead of void for operator=
61 *
62 * Revision 1.2  2002/11/04 14:55:45  tng
63 * C++ Namespace Support.
64 *
65 * Revision 1.1.1.1  2002/02/01 22:22:09  peiyongz
66 * sane_include
67 *
68 * Revision 1.1  2002/01/28 17:08:33  knoaman
69 * SAX2-ext's DeclHandler support.
70 *
71 */
72
73
74#ifndef DECLHANDLER_HPP
75#define DECLHANDLER_HPP
76
77#include <xercesc/util/XercesDefs.hpp>
78
79XERCES_CPP_NAMESPACE_BEGIN
80
81/**
82  * Receive notification of DTD declaration events.
83  *
84  * <p>This is an optional extension handler for SAX2 to provide more
85  * complete information about DTD declarations in an XML document.
86  * XML readers are not required to recognize this handler, and it is not
87  * part of core-only SAX2 distributions.</p>
88  *
89  * <p>Note that data-related DTD declarations (unparsed entities and
90  * notations) are already reported through the DTDHandler interface.</p>
91  *
92  * <p>If you are using the declaration handler together with a lexical
93  * handler, all of the events will occur between the startDTD and the endDTD
94  * events.</p>
95  *
96  * @see SAX2XMLReader#setLexicalHandler
97  * @see SAX2XMLReader#setDeclarationHandler
98  */
99
100class SAX2_EXPORT DeclHandler
101{
102public:
103    /** @name Constructors and Destructor */
104    //@{
105    /** Default constructor */
106    DeclHandler()
107    {
108    }
109
110    /** Destructor */
111    virtual ~DeclHandler()
112    {
113    }
114    //@}
115
116    /** @name The virtual declaration handler interface */
117
118    //@{
119   /**
120    * Report an element type declaration.
121    *
122    * <p>The content model will consist of the string "EMPTY", the string
123    * "ANY", or a parenthesised group, optionally followed by an occurrence
124    * indicator. The model will be normalized so that all parameter entities
125    * are fully resolved and all whitespace is removed,and will include the
126    * enclosing parentheses. Other normalization (such as removing redundant
127    * parentheses or simplifying occurrence indicators) is at the discretion
128    * of the parser.</p>
129    *
130    * @param name The element type name.
131    * @param model The content model as a normalized string.
132    * @exception SAXException Any SAX exception, possibly
133    *            wrapping another exception.
134    */
135    virtual void elementDecl
136    (
137        const   XMLCh* const    name
138        , const XMLCh* const    model
139    ) = 0;
140
141   /**
142    * Report an attribute type declaration.
143    *
144    * <p>The Parser will call this method to report each occurence of
145    * a comment in the XML document.</p>
146    *
147    * <p>The application must not attempt to read from the array
148    * outside of the specified range.</p>
149    *
150    * @param eName The name of the associated element.
151    * @param aName The name of the attribute.
152    * @param type A string representing the attribute type.
153    * @param mode A string representing the attribute defaulting mode ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies.
154    * @param value A string representing the attribute's default value, or null if there is none.
155    * @exception SAXException Any SAX exception, possibly
156    *            wrapping another exception.
157    */
158    virtual void attributeDecl
159    (
160        const   XMLCh* const    eName
161        , const XMLCh* const    aName
162        , const XMLCh* const    type
163        , const XMLCh* const    mode
164        , const XMLCh* const    value
165    ) = 0;
166
167   /**
168    * Report an internal entity declaration.
169    *
170    * <p>Only the effective (first) declaration for each entity will be
171    * reported. All parameter entities in the value will be expanded, but
172    * general entities will not.</p>
173    *
174    * @param name The name of the entity. If it is a parameter entity, the name will begin with '%'.
175    * @param value The replacement text of the entity.
176    * @exception SAXException Any SAX exception, possibly
177    *            wrapping another exception.
178    */
179    virtual void internalEntityDecl
180    (
181        const   XMLCh* const    name
182        , const XMLCh* const    value
183    ) = 0;
184
185   /**
186    * Report a parsed external entity declaration.
187    *
188    * <p>Only the effective (first) declaration for each entity will
189    * be reported.</p>
190    *
191    * @param name The name of the entity. If it is a parameter entity, the name will begin with '%'.
192    * @param publicId The The declared public identifier of the entity, or null if none was declared.
193    * @param systemId The declared system identifier of the entity.
194    * @exception SAXException Any SAX exception, possibly
195    *            wrapping another exception.
196    */
197    virtual void externalEntityDecl
198    (
199        const   XMLCh* const    name
200        , const XMLCh* const    publicId
201        , const XMLCh* const    systemId
202    ) = 0;
203
204    //@}
205private :
206    /* Unimplemented Constructors and operators */
207    /* Copy constructor */
208    DeclHandler(const DeclHandler&);
209    /** Assignment operator */
210    DeclHandler& operator=(const DeclHandler&);
211};
212
213XERCES_CPP_NAMESPACE_END
214
215#endif
Note: See TracBrowser for help on using the repository browser.