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: DocTypeHandler.hpp,v $
|
---|
59 | * Revision 1.4 2003/03/07 18:17:12 tng
|
---|
60 | * Return a reference instead of void for operator=
|
---|
61 | *
|
---|
62 | * Revision 1.3 2002/11/04 14:50:40 tng
|
---|
63 | * C++ Namespace Support.
|
---|
64 | *
|
---|
65 | * Revision 1.2 2002/08/14 15:20:38 knoaman
|
---|
66 | * [Bug 3111] Problem with LexicalHandler::startDTD() and LexicalHandler::endDTD().
|
---|
67 | *
|
---|
68 | * Revision 1.1.1.1 2002/02/01 22:22:43 peiyongz
|
---|
69 | * sane_include
|
---|
70 | *
|
---|
71 | * Revision 1.5 2001/06/19 16:43:46 tng
|
---|
72 | * Correct description of DocTypeHandler
|
---|
73 | *
|
---|
74 | * Revision 1.4 2000/03/02 19:55:39 roddey
|
---|
75 | * This checkin includes many changes done while waiting for the
|
---|
76 | * 1.1.0 code to be finished. I can't list them all here, but a list is
|
---|
77 | * available elsewhere.
|
---|
78 | *
|
---|
79 | * Revision 1.3 2000/02/24 20:16:49 abagchi
|
---|
80 | * Swat for removing Log from API docs
|
---|
81 | *
|
---|
82 | * Revision 1.2 2000/02/09 21:42:39 abagchi
|
---|
83 | * Copyright swat
|
---|
84 | *
|
---|
85 | * Revision 1.1.1.1 1999/11/09 01:03:21 twl
|
---|
86 | * Initial checkin
|
---|
87 | *
|
---|
88 | * Revision 1.2 1999/11/08 20:45:43 rahul
|
---|
89 | * Swat for adding in Product name and CVS comment log variable.
|
---|
90 | *
|
---|
91 | */
|
---|
92 |
|
---|
93 |
|
---|
94 |
|
---|
95 | #if !defined(DOCTYPEHANDLER_HPP)
|
---|
96 | #define DOCTYPEHANDLER_HPP
|
---|
97 |
|
---|
98 | #include <xercesc/util/XercesDefs.hpp>
|
---|
99 | #include <xercesc/framework/XMLNotationDecl.hpp>
|
---|
100 | #include <xercesc/validators/DTD/DTDAttDef.hpp>
|
---|
101 | #include <xercesc/validators/DTD/DTDElementDecl.hpp>
|
---|
102 | #include <xercesc/validators/DTD/DTDEntityDecl.hpp>
|
---|
103 |
|
---|
104 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
105 |
|
---|
106 | //
|
---|
107 | // This abstract class defines the document type handler API's which can be
|
---|
108 | // used to process the DTD events generated by the DTDScanner as it scans the
|
---|
109 | // internal and external subset.
|
---|
110 |
|
---|
111 | class VALIDATORS_EXPORT DocTypeHandler
|
---|
112 | {
|
---|
113 | public:
|
---|
114 | // -----------------------------------------------------------------------
|
---|
115 | // Constructors and Destructor
|
---|
116 | // -----------------------------------------------------------------------
|
---|
117 | DocTypeHandler()
|
---|
118 | {
|
---|
119 | }
|
---|
120 |
|
---|
121 | virtual ~DocTypeHandler()
|
---|
122 | {
|
---|
123 | }
|
---|
124 |
|
---|
125 |
|
---|
126 | // -----------------------------------------------------------------------
|
---|
127 | // The document type handler virtual handler interface
|
---|
128 | // -----------------------------------------------------------------------
|
---|
129 | virtual void attDef
|
---|
130 | (
|
---|
131 | const DTDElementDecl& elemDecl
|
---|
132 | , const DTDAttDef& attDef
|
---|
133 | , const bool ignoring
|
---|
134 | ) = 0;
|
---|
135 |
|
---|
136 | virtual void doctypeComment
|
---|
137 | (
|
---|
138 | const XMLCh* const comment
|
---|
139 | ) = 0;
|
---|
140 |
|
---|
141 | virtual void doctypeDecl
|
---|
142 | (
|
---|
143 | const DTDElementDecl& elemDecl
|
---|
144 | , const XMLCh* const publicId
|
---|
145 | , const XMLCh* const systemId
|
---|
146 | , const bool hasIntSubset
|
---|
147 | , const bool hasExtSubset = false
|
---|
148 | ) = 0;
|
---|
149 |
|
---|
150 | virtual void doctypePI
|
---|
151 | (
|
---|
152 | const XMLCh* const target
|
---|
153 | , const XMLCh* const data
|
---|
154 | ) = 0;
|
---|
155 |
|
---|
156 | virtual void doctypeWhitespace
|
---|
157 | (
|
---|
158 | const XMLCh* const chars
|
---|
159 | , const unsigned int length
|
---|
160 | ) = 0;
|
---|
161 |
|
---|
162 | virtual void elementDecl
|
---|
163 | (
|
---|
164 | const DTDElementDecl& decl
|
---|
165 | , const bool isIgnored
|
---|
166 | ) = 0;
|
---|
167 |
|
---|
168 | virtual void endAttList
|
---|
169 | (
|
---|
170 | const DTDElementDecl& elemDecl
|
---|
171 | ) = 0;
|
---|
172 |
|
---|
173 | virtual void endIntSubset() = 0;
|
---|
174 |
|
---|
175 | virtual void endExtSubset() = 0;
|
---|
176 |
|
---|
177 | virtual void entityDecl
|
---|
178 | (
|
---|
179 | const DTDEntityDecl& entityDecl
|
---|
180 | , const bool isPEDecl
|
---|
181 | , const bool isIgnored
|
---|
182 | ) = 0;
|
---|
183 |
|
---|
184 | virtual void resetDocType() = 0;
|
---|
185 |
|
---|
186 | virtual void notationDecl
|
---|
187 | (
|
---|
188 | const XMLNotationDecl& notDecl
|
---|
189 | , const bool isIgnored
|
---|
190 | ) = 0;
|
---|
191 |
|
---|
192 | virtual void startAttList
|
---|
193 | (
|
---|
194 | const DTDElementDecl& elemDecl
|
---|
195 | ) = 0;
|
---|
196 |
|
---|
197 | virtual void startIntSubset() = 0;
|
---|
198 |
|
---|
199 | virtual void startExtSubset() = 0;
|
---|
200 |
|
---|
201 | virtual void TextDecl
|
---|
202 | (
|
---|
203 | const XMLCh* const versionStr
|
---|
204 | , const XMLCh* const encodingStr
|
---|
205 | ) = 0;
|
---|
206 |
|
---|
207 |
|
---|
208 | private:
|
---|
209 | // -----------------------------------------------------------------------
|
---|
210 | // Unimplemented constructors and operators
|
---|
211 | // -----------------------------------------------------------------------
|
---|
212 | DocTypeHandler(const DocTypeHandler&);
|
---|
213 | DocTypeHandler& operator=(const DocTypeHandler&);
|
---|
214 | };
|
---|
215 |
|
---|
216 | XERCES_CPP_NAMESPACE_END
|
---|
217 |
|
---|
218 | #endif
|
---|