|
1 /* |
|
2 * Licensed to the Apache Software Foundation (ASF) under one or more |
|
3 * contributor license agreements. See the NOTICE file distributed with |
|
4 * this work for additional information regarding copyright ownership. |
|
5 * The ASF licenses this file to You under the Apache License, Version 2.0 |
|
6 * (the "License"); you may not use this file except in compliance with |
|
7 * the License. You may obtain a copy of the License at |
|
8 * |
|
9 * http://www.apache.org/licenses/LICENSE-2.0 |
|
10 * |
|
11 * Unless required by applicable law or agreed to in writing, software |
|
12 * distributed under the License is distributed on an "AS IS" BASIS, |
|
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 * See the License for the specific language governing permissions and |
|
15 * limitations under the License. |
|
16 */ |
|
17 |
|
18 /* |
|
19 * $Id: DocTypeHandler.hpp 568078 2007-08-21 11:43:25Z amassari $ |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 #if !defined(DOCTYPEHANDLER_HPP) |
|
25 #define DOCTYPEHANDLER_HPP |
|
26 |
|
27 #include <xercesc/util/XercesDefs.hpp> |
|
28 #include <xercesc/framework/XMLNotationDecl.hpp> |
|
29 #include <xercesc/validators/DTD/DTDAttDef.hpp> |
|
30 #include <xercesc/validators/DTD/DTDElementDecl.hpp> |
|
31 #include <xercesc/validators/DTD/DTDEntityDecl.hpp> |
|
32 |
|
33 XERCES_CPP_NAMESPACE_BEGIN |
|
34 |
|
35 // |
|
36 // This abstract class defines the document type handler API's which can be |
|
37 // used to process the DTD events generated by the DTDScanner as it scans the |
|
38 // internal and external subset. |
|
39 |
|
40 class VALIDATORS_EXPORT DocTypeHandler |
|
41 { |
|
42 public: |
|
43 // ----------------------------------------------------------------------- |
|
44 // Constructors and Destructor |
|
45 // ----------------------------------------------------------------------- |
|
46 DocTypeHandler() |
|
47 { |
|
48 } |
|
49 |
|
50 virtual ~DocTypeHandler() |
|
51 { |
|
52 } |
|
53 |
|
54 |
|
55 // ----------------------------------------------------------------------- |
|
56 // The document type handler virtual handler interface |
|
57 // ----------------------------------------------------------------------- |
|
58 virtual void attDef |
|
59 ( |
|
60 const DTDElementDecl& elemDecl |
|
61 , const DTDAttDef& attDef |
|
62 , const bool ignoring |
|
63 ) = 0; |
|
64 |
|
65 virtual void doctypeComment |
|
66 ( |
|
67 const XMLCh* const comment |
|
68 ) = 0; |
|
69 |
|
70 virtual void doctypeDecl |
|
71 ( |
|
72 const DTDElementDecl& elemDecl |
|
73 , const XMLCh* const publicId |
|
74 , const XMLCh* const systemId |
|
75 , const bool hasIntSubset |
|
76 , const bool hasExtSubset = false |
|
77 ) = 0; |
|
78 |
|
79 virtual void doctypePI |
|
80 ( |
|
81 const XMLCh* const target |
|
82 , const XMLCh* const data |
|
83 ) = 0; |
|
84 |
|
85 virtual void doctypeWhitespace |
|
86 ( |
|
87 const XMLCh* const chars |
|
88 , const unsigned int length |
|
89 ) = 0; |
|
90 |
|
91 virtual void elementDecl |
|
92 ( |
|
93 const DTDElementDecl& decl |
|
94 , const bool isIgnored |
|
95 ) = 0; |
|
96 |
|
97 virtual void endAttList |
|
98 ( |
|
99 const DTDElementDecl& elemDecl |
|
100 ) = 0; |
|
101 |
|
102 virtual void endIntSubset() = 0; |
|
103 |
|
104 virtual void endExtSubset() = 0; |
|
105 |
|
106 virtual void entityDecl |
|
107 ( |
|
108 const DTDEntityDecl& entityDecl |
|
109 , const bool isPEDecl |
|
110 , const bool isIgnored |
|
111 ) = 0; |
|
112 |
|
113 virtual void resetDocType() = 0; |
|
114 |
|
115 virtual void notationDecl |
|
116 ( |
|
117 const XMLNotationDecl& notDecl |
|
118 , const bool isIgnored |
|
119 ) = 0; |
|
120 |
|
121 virtual void startAttList |
|
122 ( |
|
123 const DTDElementDecl& elemDecl |
|
124 ) = 0; |
|
125 |
|
126 virtual void startIntSubset() = 0; |
|
127 |
|
128 virtual void startExtSubset() = 0; |
|
129 |
|
130 virtual void TextDecl |
|
131 ( |
|
132 const XMLCh* const versionStr |
|
133 , const XMLCh* const encodingStr |
|
134 ) = 0; |
|
135 |
|
136 |
|
137 private: |
|
138 // ----------------------------------------------------------------------- |
|
139 // Unimplemented constructors and operators |
|
140 // ----------------------------------------------------------------------- |
|
141 DocTypeHandler(const DocTypeHandler&); |
|
142 DocTypeHandler& operator=(const DocTypeHandler&); |
|
143 }; |
|
144 |
|
145 XERCES_CPP_NAMESPACE_END |
|
146 |
|
147 #endif |