1 | n/a | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd |
---|
2 | n/a | See the file COPYING for copying permission. |
---|
3 | n/a | */ |
---|
4 | n/a | |
---|
5 | n/a | #include <stddef.h> |
---|
6 | n/a | |
---|
7 | n/a | #ifdef COMPILED_FROM_DSP |
---|
8 | n/a | #include "winconfig.h" |
---|
9 | n/a | #elif defined(MACOS_CLASSIC) |
---|
10 | n/a | #include "macconfig.h" |
---|
11 | n/a | #elif defined(__amigaos__) |
---|
12 | n/a | #include "amigaconfig.h" |
---|
13 | n/a | #elif defined(__WATCOMC__) |
---|
14 | n/a | #include "watcomconfig.h" |
---|
15 | n/a | #else |
---|
16 | n/a | #ifdef HAVE_EXPAT_CONFIG_H |
---|
17 | n/a | #include <expat_config.h> |
---|
18 | n/a | #endif |
---|
19 | n/a | #endif /* ndef COMPILED_FROM_DSP */ |
---|
20 | n/a | |
---|
21 | n/a | #include "expat_external.h" |
---|
22 | n/a | #include "internal.h" |
---|
23 | n/a | #include "xmlrole.h" |
---|
24 | n/a | #include "ascii.h" |
---|
25 | n/a | |
---|
26 | n/a | /* Doesn't check: |
---|
27 | n/a | |
---|
28 | n/a | that ,| are not mixed in a model group |
---|
29 | n/a | content of literals |
---|
30 | n/a | |
---|
31 | n/a | */ |
---|
32 | n/a | |
---|
33 | n/a | static const char KW_ANY[] = { |
---|
34 | n/a | ASCII_A, ASCII_N, ASCII_Y, '\0' }; |
---|
35 | n/a | static const char KW_ATTLIST[] = { |
---|
36 | n/a | ASCII_A, ASCII_T, ASCII_T, ASCII_L, ASCII_I, ASCII_S, ASCII_T, '\0' }; |
---|
37 | n/a | static const char KW_CDATA[] = { |
---|
38 | n/a | ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; |
---|
39 | n/a | static const char KW_DOCTYPE[] = { |
---|
40 | n/a | ASCII_D, ASCII_O, ASCII_C, ASCII_T, ASCII_Y, ASCII_P, ASCII_E, '\0' }; |
---|
41 | n/a | static const char KW_ELEMENT[] = { |
---|
42 | n/a | ASCII_E, ASCII_L, ASCII_E, ASCII_M, ASCII_E, ASCII_N, ASCII_T, '\0' }; |
---|
43 | n/a | static const char KW_EMPTY[] = { |
---|
44 | n/a | ASCII_E, ASCII_M, ASCII_P, ASCII_T, ASCII_Y, '\0' }; |
---|
45 | n/a | static const char KW_ENTITIES[] = { |
---|
46 | n/a | ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_I, ASCII_E, ASCII_S, |
---|
47 | n/a | '\0' }; |
---|
48 | n/a | static const char KW_ENTITY[] = { |
---|
49 | n/a | ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_Y, '\0' }; |
---|
50 | n/a | static const char KW_FIXED[] = { |
---|
51 | n/a | ASCII_F, ASCII_I, ASCII_X, ASCII_E, ASCII_D, '\0' }; |
---|
52 | n/a | static const char KW_ID[] = { |
---|
53 | n/a | ASCII_I, ASCII_D, '\0' }; |
---|
54 | n/a | static const char KW_IDREF[] = { |
---|
55 | n/a | ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' }; |
---|
56 | n/a | static const char KW_IDREFS[] = { |
---|
57 | n/a | ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' }; |
---|
58 | n/a | #ifdef XML_DTD |
---|
59 | n/a | static const char KW_IGNORE[] = { |
---|
60 | n/a | ASCII_I, ASCII_G, ASCII_N, ASCII_O, ASCII_R, ASCII_E, '\0' }; |
---|
61 | n/a | #endif |
---|
62 | n/a | static const char KW_IMPLIED[] = { |
---|
63 | n/a | ASCII_I, ASCII_M, ASCII_P, ASCII_L, ASCII_I, ASCII_E, ASCII_D, '\0' }; |
---|
64 | n/a | #ifdef XML_DTD |
---|
65 | n/a | static const char KW_INCLUDE[] = { |
---|
66 | n/a | ASCII_I, ASCII_N, ASCII_C, ASCII_L, ASCII_U, ASCII_D, ASCII_E, '\0' }; |
---|
67 | n/a | #endif |
---|
68 | n/a | static const char KW_NDATA[] = { |
---|
69 | n/a | ASCII_N, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; |
---|
70 | n/a | static const char KW_NMTOKEN[] = { |
---|
71 | n/a | ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0' }; |
---|
72 | n/a | static const char KW_NMTOKENS[] = { |
---|
73 | n/a | ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, |
---|
74 | n/a | '\0' }; |
---|
75 | n/a | static const char KW_NOTATION[] = |
---|
76 | n/a | { ASCII_N, ASCII_O, ASCII_T, ASCII_A, ASCII_T, ASCII_I, ASCII_O, ASCII_N, |
---|
77 | n/a | '\0' }; |
---|
78 | n/a | static const char KW_PCDATA[] = { |
---|
79 | n/a | ASCII_P, ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; |
---|
80 | n/a | static const char KW_PUBLIC[] = { |
---|
81 | n/a | ASCII_P, ASCII_U, ASCII_B, ASCII_L, ASCII_I, ASCII_C, '\0' }; |
---|
82 | n/a | static const char KW_REQUIRED[] = { |
---|
83 | n/a | ASCII_R, ASCII_E, ASCII_Q, ASCII_U, ASCII_I, ASCII_R, ASCII_E, ASCII_D, |
---|
84 | n/a | '\0' }; |
---|
85 | n/a | static const char KW_SYSTEM[] = { |
---|
86 | n/a | ASCII_S, ASCII_Y, ASCII_S, ASCII_T, ASCII_E, ASCII_M, '\0' }; |
---|
87 | n/a | |
---|
88 | n/a | #ifndef MIN_BYTES_PER_CHAR |
---|
89 | n/a | #define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar) |
---|
90 | n/a | #endif |
---|
91 | n/a | |
---|
92 | n/a | #ifdef XML_DTD |
---|
93 | n/a | #define setTopLevel(state) \ |
---|
94 | n/a | ((state)->handler = ((state)->documentEntity \ |
---|
95 | n/a | ? internalSubset \ |
---|
96 | n/a | : externalSubset1)) |
---|
97 | n/a | #else /* not XML_DTD */ |
---|
98 | n/a | #define setTopLevel(state) ((state)->handler = internalSubset) |
---|
99 | n/a | #endif /* not XML_DTD */ |
---|
100 | n/a | |
---|
101 | n/a | typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state, |
---|
102 | n/a | int tok, |
---|
103 | n/a | const char *ptr, |
---|
104 | n/a | const char *end, |
---|
105 | n/a | const ENCODING *enc); |
---|
106 | n/a | |
---|
107 | n/a | static PROLOG_HANDLER |
---|
108 | n/a | prolog0, prolog1, prolog2, |
---|
109 | n/a | doctype0, doctype1, doctype2, doctype3, doctype4, doctype5, |
---|
110 | n/a | internalSubset, |
---|
111 | n/a | entity0, entity1, entity2, entity3, entity4, entity5, entity6, |
---|
112 | n/a | entity7, entity8, entity9, entity10, |
---|
113 | n/a | notation0, notation1, notation2, notation3, notation4, |
---|
114 | n/a | attlist0, attlist1, attlist2, attlist3, attlist4, attlist5, attlist6, |
---|
115 | n/a | attlist7, attlist8, attlist9, |
---|
116 | n/a | element0, element1, element2, element3, element4, element5, element6, |
---|
117 | n/a | element7, |
---|
118 | n/a | #ifdef XML_DTD |
---|
119 | n/a | externalSubset0, externalSubset1, |
---|
120 | n/a | condSect0, condSect1, condSect2, |
---|
121 | n/a | #endif /* XML_DTD */ |
---|
122 | n/a | declClose, |
---|
123 | n/a | error; |
---|
124 | n/a | |
---|
125 | n/a | static int FASTCALL common(PROLOG_STATE *state, int tok); |
---|
126 | n/a | |
---|
127 | n/a | static int PTRCALL |
---|
128 | n/a | prolog0(PROLOG_STATE *state, |
---|
129 | n/a | int tok, |
---|
130 | n/a | const char *ptr, |
---|
131 | n/a | const char *end, |
---|
132 | n/a | const ENCODING *enc) |
---|
133 | n/a | { |
---|
134 | n/a | switch (tok) { |
---|
135 | n/a | case XML_TOK_PROLOG_S: |
---|
136 | n/a | state->handler = prolog1; |
---|
137 | n/a | return XML_ROLE_NONE; |
---|
138 | n/a | case XML_TOK_XML_DECL: |
---|
139 | n/a | state->handler = prolog1; |
---|
140 | n/a | return XML_ROLE_XML_DECL; |
---|
141 | n/a | case XML_TOK_PI: |
---|
142 | n/a | state->handler = prolog1; |
---|
143 | n/a | return XML_ROLE_PI; |
---|
144 | n/a | case XML_TOK_COMMENT: |
---|
145 | n/a | state->handler = prolog1; |
---|
146 | n/a | return XML_ROLE_COMMENT; |
---|
147 | n/a | case XML_TOK_BOM: |
---|
148 | n/a | return XML_ROLE_NONE; |
---|
149 | n/a | case XML_TOK_DECL_OPEN: |
---|
150 | n/a | if (!XmlNameMatchesAscii(enc, |
---|
151 | n/a | ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
---|
152 | n/a | end, |
---|
153 | n/a | KW_DOCTYPE)) |
---|
154 | n/a | break; |
---|
155 | n/a | state->handler = doctype0; |
---|
156 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
157 | n/a | case XML_TOK_INSTANCE_START: |
---|
158 | n/a | state->handler = error; |
---|
159 | n/a | return XML_ROLE_INSTANCE_START; |
---|
160 | n/a | } |
---|
161 | n/a | return common(state, tok); |
---|
162 | n/a | } |
---|
163 | n/a | |
---|
164 | n/a | static int PTRCALL |
---|
165 | n/a | prolog1(PROLOG_STATE *state, |
---|
166 | n/a | int tok, |
---|
167 | n/a | const char *ptr, |
---|
168 | n/a | const char *end, |
---|
169 | n/a | const ENCODING *enc) |
---|
170 | n/a | { |
---|
171 | n/a | switch (tok) { |
---|
172 | n/a | case XML_TOK_PROLOG_S: |
---|
173 | n/a | return XML_ROLE_NONE; |
---|
174 | n/a | case XML_TOK_PI: |
---|
175 | n/a | return XML_ROLE_PI; |
---|
176 | n/a | case XML_TOK_COMMENT: |
---|
177 | n/a | return XML_ROLE_COMMENT; |
---|
178 | n/a | case XML_TOK_BOM: |
---|
179 | n/a | return XML_ROLE_NONE; |
---|
180 | n/a | case XML_TOK_DECL_OPEN: |
---|
181 | n/a | if (!XmlNameMatchesAscii(enc, |
---|
182 | n/a | ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
---|
183 | n/a | end, |
---|
184 | n/a | KW_DOCTYPE)) |
---|
185 | n/a | break; |
---|
186 | n/a | state->handler = doctype0; |
---|
187 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
188 | n/a | case XML_TOK_INSTANCE_START: |
---|
189 | n/a | state->handler = error; |
---|
190 | n/a | return XML_ROLE_INSTANCE_START; |
---|
191 | n/a | } |
---|
192 | n/a | return common(state, tok); |
---|
193 | n/a | } |
---|
194 | n/a | |
---|
195 | n/a | static int PTRCALL |
---|
196 | n/a | prolog2(PROLOG_STATE *state, |
---|
197 | n/a | int tok, |
---|
198 | n/a | const char *ptr, |
---|
199 | n/a | const char *end, |
---|
200 | n/a | const ENCODING *enc) |
---|
201 | n/a | { |
---|
202 | n/a | switch (tok) { |
---|
203 | n/a | case XML_TOK_PROLOG_S: |
---|
204 | n/a | return XML_ROLE_NONE; |
---|
205 | n/a | case XML_TOK_PI: |
---|
206 | n/a | return XML_ROLE_PI; |
---|
207 | n/a | case XML_TOK_COMMENT: |
---|
208 | n/a | return XML_ROLE_COMMENT; |
---|
209 | n/a | case XML_TOK_INSTANCE_START: |
---|
210 | n/a | state->handler = error; |
---|
211 | n/a | return XML_ROLE_INSTANCE_START; |
---|
212 | n/a | } |
---|
213 | n/a | return common(state, tok); |
---|
214 | n/a | } |
---|
215 | n/a | |
---|
216 | n/a | static int PTRCALL |
---|
217 | n/a | doctype0(PROLOG_STATE *state, |
---|
218 | n/a | int tok, |
---|
219 | n/a | const char *ptr, |
---|
220 | n/a | const char *end, |
---|
221 | n/a | const ENCODING *enc) |
---|
222 | n/a | { |
---|
223 | n/a | switch (tok) { |
---|
224 | n/a | case XML_TOK_PROLOG_S: |
---|
225 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
226 | n/a | case XML_TOK_NAME: |
---|
227 | n/a | case XML_TOK_PREFIXED_NAME: |
---|
228 | n/a | state->handler = doctype1; |
---|
229 | n/a | return XML_ROLE_DOCTYPE_NAME; |
---|
230 | n/a | } |
---|
231 | n/a | return common(state, tok); |
---|
232 | n/a | } |
---|
233 | n/a | |
---|
234 | n/a | static int PTRCALL |
---|
235 | n/a | doctype1(PROLOG_STATE *state, |
---|
236 | n/a | int tok, |
---|
237 | n/a | const char *ptr, |
---|
238 | n/a | const char *end, |
---|
239 | n/a | const ENCODING *enc) |
---|
240 | n/a | { |
---|
241 | n/a | switch (tok) { |
---|
242 | n/a | case XML_TOK_PROLOG_S: |
---|
243 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
244 | n/a | case XML_TOK_OPEN_BRACKET: |
---|
245 | n/a | state->handler = internalSubset; |
---|
246 | n/a | return XML_ROLE_DOCTYPE_INTERNAL_SUBSET; |
---|
247 | n/a | case XML_TOK_DECL_CLOSE: |
---|
248 | n/a | state->handler = prolog2; |
---|
249 | n/a | return XML_ROLE_DOCTYPE_CLOSE; |
---|
250 | n/a | case XML_TOK_NAME: |
---|
251 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { |
---|
252 | n/a | state->handler = doctype3; |
---|
253 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
254 | n/a | } |
---|
255 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { |
---|
256 | n/a | state->handler = doctype2; |
---|
257 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
258 | n/a | } |
---|
259 | n/a | break; |
---|
260 | n/a | } |
---|
261 | n/a | return common(state, tok); |
---|
262 | n/a | } |
---|
263 | n/a | |
---|
264 | n/a | static int PTRCALL |
---|
265 | n/a | doctype2(PROLOG_STATE *state, |
---|
266 | n/a | int tok, |
---|
267 | n/a | const char *ptr, |
---|
268 | n/a | const char *end, |
---|
269 | n/a | const ENCODING *enc) |
---|
270 | n/a | { |
---|
271 | n/a | switch (tok) { |
---|
272 | n/a | case XML_TOK_PROLOG_S: |
---|
273 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
274 | n/a | case XML_TOK_LITERAL: |
---|
275 | n/a | state->handler = doctype3; |
---|
276 | n/a | return XML_ROLE_DOCTYPE_PUBLIC_ID; |
---|
277 | n/a | } |
---|
278 | n/a | return common(state, tok); |
---|
279 | n/a | } |
---|
280 | n/a | |
---|
281 | n/a | static int PTRCALL |
---|
282 | n/a | doctype3(PROLOG_STATE *state, |
---|
283 | n/a | int tok, |
---|
284 | n/a | const char *ptr, |
---|
285 | n/a | const char *end, |
---|
286 | n/a | const ENCODING *enc) |
---|
287 | n/a | { |
---|
288 | n/a | switch (tok) { |
---|
289 | n/a | case XML_TOK_PROLOG_S: |
---|
290 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
291 | n/a | case XML_TOK_LITERAL: |
---|
292 | n/a | state->handler = doctype4; |
---|
293 | n/a | return XML_ROLE_DOCTYPE_SYSTEM_ID; |
---|
294 | n/a | } |
---|
295 | n/a | return common(state, tok); |
---|
296 | n/a | } |
---|
297 | n/a | |
---|
298 | n/a | static int PTRCALL |
---|
299 | n/a | doctype4(PROLOG_STATE *state, |
---|
300 | n/a | int tok, |
---|
301 | n/a | const char *ptr, |
---|
302 | n/a | const char *end, |
---|
303 | n/a | const ENCODING *enc) |
---|
304 | n/a | { |
---|
305 | n/a | switch (tok) { |
---|
306 | n/a | case XML_TOK_PROLOG_S: |
---|
307 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
308 | n/a | case XML_TOK_OPEN_BRACKET: |
---|
309 | n/a | state->handler = internalSubset; |
---|
310 | n/a | return XML_ROLE_DOCTYPE_INTERNAL_SUBSET; |
---|
311 | n/a | case XML_TOK_DECL_CLOSE: |
---|
312 | n/a | state->handler = prolog2; |
---|
313 | n/a | return XML_ROLE_DOCTYPE_CLOSE; |
---|
314 | n/a | } |
---|
315 | n/a | return common(state, tok); |
---|
316 | n/a | } |
---|
317 | n/a | |
---|
318 | n/a | static int PTRCALL |
---|
319 | n/a | doctype5(PROLOG_STATE *state, |
---|
320 | n/a | int tok, |
---|
321 | n/a | const char *ptr, |
---|
322 | n/a | const char *end, |
---|
323 | n/a | const ENCODING *enc) |
---|
324 | n/a | { |
---|
325 | n/a | switch (tok) { |
---|
326 | n/a | case XML_TOK_PROLOG_S: |
---|
327 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
328 | n/a | case XML_TOK_DECL_CLOSE: |
---|
329 | n/a | state->handler = prolog2; |
---|
330 | n/a | return XML_ROLE_DOCTYPE_CLOSE; |
---|
331 | n/a | } |
---|
332 | n/a | return common(state, tok); |
---|
333 | n/a | } |
---|
334 | n/a | |
---|
335 | n/a | static int PTRCALL |
---|
336 | n/a | internalSubset(PROLOG_STATE *state, |
---|
337 | n/a | int tok, |
---|
338 | n/a | const char *ptr, |
---|
339 | n/a | const char *end, |
---|
340 | n/a | const ENCODING *enc) |
---|
341 | n/a | { |
---|
342 | n/a | switch (tok) { |
---|
343 | n/a | case XML_TOK_PROLOG_S: |
---|
344 | n/a | return XML_ROLE_NONE; |
---|
345 | n/a | case XML_TOK_DECL_OPEN: |
---|
346 | n/a | if (XmlNameMatchesAscii(enc, |
---|
347 | n/a | ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
---|
348 | n/a | end, |
---|
349 | n/a | KW_ENTITY)) { |
---|
350 | n/a | state->handler = entity0; |
---|
351 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
352 | n/a | } |
---|
353 | n/a | if (XmlNameMatchesAscii(enc, |
---|
354 | n/a | ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
---|
355 | n/a | end, |
---|
356 | n/a | KW_ATTLIST)) { |
---|
357 | n/a | state->handler = attlist0; |
---|
358 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
359 | n/a | } |
---|
360 | n/a | if (XmlNameMatchesAscii(enc, |
---|
361 | n/a | ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
---|
362 | n/a | end, |
---|
363 | n/a | KW_ELEMENT)) { |
---|
364 | n/a | state->handler = element0; |
---|
365 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
366 | n/a | } |
---|
367 | n/a | if (XmlNameMatchesAscii(enc, |
---|
368 | n/a | ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
---|
369 | n/a | end, |
---|
370 | n/a | KW_NOTATION)) { |
---|
371 | n/a | state->handler = notation0; |
---|
372 | n/a | return XML_ROLE_NOTATION_NONE; |
---|
373 | n/a | } |
---|
374 | n/a | break; |
---|
375 | n/a | case XML_TOK_PI: |
---|
376 | n/a | return XML_ROLE_PI; |
---|
377 | n/a | case XML_TOK_COMMENT: |
---|
378 | n/a | return XML_ROLE_COMMENT; |
---|
379 | n/a | case XML_TOK_PARAM_ENTITY_REF: |
---|
380 | n/a | return XML_ROLE_PARAM_ENTITY_REF; |
---|
381 | n/a | case XML_TOK_CLOSE_BRACKET: |
---|
382 | n/a | state->handler = doctype5; |
---|
383 | n/a | return XML_ROLE_DOCTYPE_NONE; |
---|
384 | n/a | case XML_TOK_NONE: |
---|
385 | n/a | return XML_ROLE_NONE; |
---|
386 | n/a | } |
---|
387 | n/a | return common(state, tok); |
---|
388 | n/a | } |
---|
389 | n/a | |
---|
390 | n/a | #ifdef XML_DTD |
---|
391 | n/a | |
---|
392 | n/a | static int PTRCALL |
---|
393 | n/a | externalSubset0(PROLOG_STATE *state, |
---|
394 | n/a | int tok, |
---|
395 | n/a | const char *ptr, |
---|
396 | n/a | const char *end, |
---|
397 | n/a | const ENCODING *enc) |
---|
398 | n/a | { |
---|
399 | n/a | state->handler = externalSubset1; |
---|
400 | n/a | if (tok == XML_TOK_XML_DECL) |
---|
401 | n/a | return XML_ROLE_TEXT_DECL; |
---|
402 | n/a | return externalSubset1(state, tok, ptr, end, enc); |
---|
403 | n/a | } |
---|
404 | n/a | |
---|
405 | n/a | static int PTRCALL |
---|
406 | n/a | externalSubset1(PROLOG_STATE *state, |
---|
407 | n/a | int tok, |
---|
408 | n/a | const char *ptr, |
---|
409 | n/a | const char *end, |
---|
410 | n/a | const ENCODING *enc) |
---|
411 | n/a | { |
---|
412 | n/a | switch (tok) { |
---|
413 | n/a | case XML_TOK_COND_SECT_OPEN: |
---|
414 | n/a | state->handler = condSect0; |
---|
415 | n/a | return XML_ROLE_NONE; |
---|
416 | n/a | case XML_TOK_COND_SECT_CLOSE: |
---|
417 | n/a | if (state->includeLevel == 0) |
---|
418 | n/a | break; |
---|
419 | n/a | state->includeLevel -= 1; |
---|
420 | n/a | return XML_ROLE_NONE; |
---|
421 | n/a | case XML_TOK_PROLOG_S: |
---|
422 | n/a | return XML_ROLE_NONE; |
---|
423 | n/a | case XML_TOK_CLOSE_BRACKET: |
---|
424 | n/a | break; |
---|
425 | n/a | case XML_TOK_NONE: |
---|
426 | n/a | if (state->includeLevel) |
---|
427 | n/a | break; |
---|
428 | n/a | return XML_ROLE_NONE; |
---|
429 | n/a | default: |
---|
430 | n/a | return internalSubset(state, tok, ptr, end, enc); |
---|
431 | n/a | } |
---|
432 | n/a | return common(state, tok); |
---|
433 | n/a | } |
---|
434 | n/a | |
---|
435 | n/a | #endif /* XML_DTD */ |
---|
436 | n/a | |
---|
437 | n/a | static int PTRCALL |
---|
438 | n/a | entity0(PROLOG_STATE *state, |
---|
439 | n/a | int tok, |
---|
440 | n/a | const char *ptr, |
---|
441 | n/a | const char *end, |
---|
442 | n/a | const ENCODING *enc) |
---|
443 | n/a | { |
---|
444 | n/a | switch (tok) { |
---|
445 | n/a | case XML_TOK_PROLOG_S: |
---|
446 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
447 | n/a | case XML_TOK_PERCENT: |
---|
448 | n/a | state->handler = entity1; |
---|
449 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
450 | n/a | case XML_TOK_NAME: |
---|
451 | n/a | state->handler = entity2; |
---|
452 | n/a | return XML_ROLE_GENERAL_ENTITY_NAME; |
---|
453 | n/a | } |
---|
454 | n/a | return common(state, tok); |
---|
455 | n/a | } |
---|
456 | n/a | |
---|
457 | n/a | static int PTRCALL |
---|
458 | n/a | entity1(PROLOG_STATE *state, |
---|
459 | n/a | int tok, |
---|
460 | n/a | const char *ptr, |
---|
461 | n/a | const char *end, |
---|
462 | n/a | const ENCODING *enc) |
---|
463 | n/a | { |
---|
464 | n/a | switch (tok) { |
---|
465 | n/a | case XML_TOK_PROLOG_S: |
---|
466 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
467 | n/a | case XML_TOK_NAME: |
---|
468 | n/a | state->handler = entity7; |
---|
469 | n/a | return XML_ROLE_PARAM_ENTITY_NAME; |
---|
470 | n/a | } |
---|
471 | n/a | return common(state, tok); |
---|
472 | n/a | } |
---|
473 | n/a | |
---|
474 | n/a | static int PTRCALL |
---|
475 | n/a | entity2(PROLOG_STATE *state, |
---|
476 | n/a | int tok, |
---|
477 | n/a | const char *ptr, |
---|
478 | n/a | const char *end, |
---|
479 | n/a | const ENCODING *enc) |
---|
480 | n/a | { |
---|
481 | n/a | switch (tok) { |
---|
482 | n/a | case XML_TOK_PROLOG_S: |
---|
483 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
484 | n/a | case XML_TOK_NAME: |
---|
485 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { |
---|
486 | n/a | state->handler = entity4; |
---|
487 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
488 | n/a | } |
---|
489 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { |
---|
490 | n/a | state->handler = entity3; |
---|
491 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
492 | n/a | } |
---|
493 | n/a | break; |
---|
494 | n/a | case XML_TOK_LITERAL: |
---|
495 | n/a | state->handler = declClose; |
---|
496 | n/a | state->role_none = XML_ROLE_ENTITY_NONE; |
---|
497 | n/a | return XML_ROLE_ENTITY_VALUE; |
---|
498 | n/a | } |
---|
499 | n/a | return common(state, tok); |
---|
500 | n/a | } |
---|
501 | n/a | |
---|
502 | n/a | static int PTRCALL |
---|
503 | n/a | entity3(PROLOG_STATE *state, |
---|
504 | n/a | int tok, |
---|
505 | n/a | const char *ptr, |
---|
506 | n/a | const char *end, |
---|
507 | n/a | const ENCODING *enc) |
---|
508 | n/a | { |
---|
509 | n/a | switch (tok) { |
---|
510 | n/a | case XML_TOK_PROLOG_S: |
---|
511 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
512 | n/a | case XML_TOK_LITERAL: |
---|
513 | n/a | state->handler = entity4; |
---|
514 | n/a | return XML_ROLE_ENTITY_PUBLIC_ID; |
---|
515 | n/a | } |
---|
516 | n/a | return common(state, tok); |
---|
517 | n/a | } |
---|
518 | n/a | |
---|
519 | n/a | static int PTRCALL |
---|
520 | n/a | entity4(PROLOG_STATE *state, |
---|
521 | n/a | int tok, |
---|
522 | n/a | const char *ptr, |
---|
523 | n/a | const char *end, |
---|
524 | n/a | const ENCODING *enc) |
---|
525 | n/a | { |
---|
526 | n/a | switch (tok) { |
---|
527 | n/a | case XML_TOK_PROLOG_S: |
---|
528 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
529 | n/a | case XML_TOK_LITERAL: |
---|
530 | n/a | state->handler = entity5; |
---|
531 | n/a | return XML_ROLE_ENTITY_SYSTEM_ID; |
---|
532 | n/a | } |
---|
533 | n/a | return common(state, tok); |
---|
534 | n/a | } |
---|
535 | n/a | |
---|
536 | n/a | static int PTRCALL |
---|
537 | n/a | entity5(PROLOG_STATE *state, |
---|
538 | n/a | int tok, |
---|
539 | n/a | const char *ptr, |
---|
540 | n/a | const char *end, |
---|
541 | n/a | const ENCODING *enc) |
---|
542 | n/a | { |
---|
543 | n/a | switch (tok) { |
---|
544 | n/a | case XML_TOK_PROLOG_S: |
---|
545 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
546 | n/a | case XML_TOK_DECL_CLOSE: |
---|
547 | n/a | setTopLevel(state); |
---|
548 | n/a | return XML_ROLE_ENTITY_COMPLETE; |
---|
549 | n/a | case XML_TOK_NAME: |
---|
550 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_NDATA)) { |
---|
551 | n/a | state->handler = entity6; |
---|
552 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
553 | n/a | } |
---|
554 | n/a | break; |
---|
555 | n/a | } |
---|
556 | n/a | return common(state, tok); |
---|
557 | n/a | } |
---|
558 | n/a | |
---|
559 | n/a | static int PTRCALL |
---|
560 | n/a | entity6(PROLOG_STATE *state, |
---|
561 | n/a | int tok, |
---|
562 | n/a | const char *ptr, |
---|
563 | n/a | const char *end, |
---|
564 | n/a | const ENCODING *enc) |
---|
565 | n/a | { |
---|
566 | n/a | switch (tok) { |
---|
567 | n/a | case XML_TOK_PROLOG_S: |
---|
568 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
569 | n/a | case XML_TOK_NAME: |
---|
570 | n/a | state->handler = declClose; |
---|
571 | n/a | state->role_none = XML_ROLE_ENTITY_NONE; |
---|
572 | n/a | return XML_ROLE_ENTITY_NOTATION_NAME; |
---|
573 | n/a | } |
---|
574 | n/a | return common(state, tok); |
---|
575 | n/a | } |
---|
576 | n/a | |
---|
577 | n/a | static int PTRCALL |
---|
578 | n/a | entity7(PROLOG_STATE *state, |
---|
579 | n/a | int tok, |
---|
580 | n/a | const char *ptr, |
---|
581 | n/a | const char *end, |
---|
582 | n/a | const ENCODING *enc) |
---|
583 | n/a | { |
---|
584 | n/a | switch (tok) { |
---|
585 | n/a | case XML_TOK_PROLOG_S: |
---|
586 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
587 | n/a | case XML_TOK_NAME: |
---|
588 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { |
---|
589 | n/a | state->handler = entity9; |
---|
590 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
591 | n/a | } |
---|
592 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { |
---|
593 | n/a | state->handler = entity8; |
---|
594 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
595 | n/a | } |
---|
596 | n/a | break; |
---|
597 | n/a | case XML_TOK_LITERAL: |
---|
598 | n/a | state->handler = declClose; |
---|
599 | n/a | state->role_none = XML_ROLE_ENTITY_NONE; |
---|
600 | n/a | return XML_ROLE_ENTITY_VALUE; |
---|
601 | n/a | } |
---|
602 | n/a | return common(state, tok); |
---|
603 | n/a | } |
---|
604 | n/a | |
---|
605 | n/a | static int PTRCALL |
---|
606 | n/a | entity8(PROLOG_STATE *state, |
---|
607 | n/a | int tok, |
---|
608 | n/a | const char *ptr, |
---|
609 | n/a | const char *end, |
---|
610 | n/a | const ENCODING *enc) |
---|
611 | n/a | { |
---|
612 | n/a | switch (tok) { |
---|
613 | n/a | case XML_TOK_PROLOG_S: |
---|
614 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
615 | n/a | case XML_TOK_LITERAL: |
---|
616 | n/a | state->handler = entity9; |
---|
617 | n/a | return XML_ROLE_ENTITY_PUBLIC_ID; |
---|
618 | n/a | } |
---|
619 | n/a | return common(state, tok); |
---|
620 | n/a | } |
---|
621 | n/a | |
---|
622 | n/a | static int PTRCALL |
---|
623 | n/a | entity9(PROLOG_STATE *state, |
---|
624 | n/a | int tok, |
---|
625 | n/a | const char *ptr, |
---|
626 | n/a | const char *end, |
---|
627 | n/a | const ENCODING *enc) |
---|
628 | n/a | { |
---|
629 | n/a | switch (tok) { |
---|
630 | n/a | case XML_TOK_PROLOG_S: |
---|
631 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
632 | n/a | case XML_TOK_LITERAL: |
---|
633 | n/a | state->handler = entity10; |
---|
634 | n/a | return XML_ROLE_ENTITY_SYSTEM_ID; |
---|
635 | n/a | } |
---|
636 | n/a | return common(state, tok); |
---|
637 | n/a | } |
---|
638 | n/a | |
---|
639 | n/a | static int PTRCALL |
---|
640 | n/a | entity10(PROLOG_STATE *state, |
---|
641 | n/a | int tok, |
---|
642 | n/a | const char *ptr, |
---|
643 | n/a | const char *end, |
---|
644 | n/a | const ENCODING *enc) |
---|
645 | n/a | { |
---|
646 | n/a | switch (tok) { |
---|
647 | n/a | case XML_TOK_PROLOG_S: |
---|
648 | n/a | return XML_ROLE_ENTITY_NONE; |
---|
649 | n/a | case XML_TOK_DECL_CLOSE: |
---|
650 | n/a | setTopLevel(state); |
---|
651 | n/a | return XML_ROLE_ENTITY_COMPLETE; |
---|
652 | n/a | } |
---|
653 | n/a | return common(state, tok); |
---|
654 | n/a | } |
---|
655 | n/a | |
---|
656 | n/a | static int PTRCALL |
---|
657 | n/a | notation0(PROLOG_STATE *state, |
---|
658 | n/a | int tok, |
---|
659 | n/a | const char *ptr, |
---|
660 | n/a | const char *end, |
---|
661 | n/a | const ENCODING *enc) |
---|
662 | n/a | { |
---|
663 | n/a | switch (tok) { |
---|
664 | n/a | case XML_TOK_PROLOG_S: |
---|
665 | n/a | return XML_ROLE_NOTATION_NONE; |
---|
666 | n/a | case XML_TOK_NAME: |
---|
667 | n/a | state->handler = notation1; |
---|
668 | n/a | return XML_ROLE_NOTATION_NAME; |
---|
669 | n/a | } |
---|
670 | n/a | return common(state, tok); |
---|
671 | n/a | } |
---|
672 | n/a | |
---|
673 | n/a | static int PTRCALL |
---|
674 | n/a | notation1(PROLOG_STATE *state, |
---|
675 | n/a | int tok, |
---|
676 | n/a | const char *ptr, |
---|
677 | n/a | const char *end, |
---|
678 | n/a | const ENCODING *enc) |
---|
679 | n/a | { |
---|
680 | n/a | switch (tok) { |
---|
681 | n/a | case XML_TOK_PROLOG_S: |
---|
682 | n/a | return XML_ROLE_NOTATION_NONE; |
---|
683 | n/a | case XML_TOK_NAME: |
---|
684 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { |
---|
685 | n/a | state->handler = notation3; |
---|
686 | n/a | return XML_ROLE_NOTATION_NONE; |
---|
687 | n/a | } |
---|
688 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { |
---|
689 | n/a | state->handler = notation2; |
---|
690 | n/a | return XML_ROLE_NOTATION_NONE; |
---|
691 | n/a | } |
---|
692 | n/a | break; |
---|
693 | n/a | } |
---|
694 | n/a | return common(state, tok); |
---|
695 | n/a | } |
---|
696 | n/a | |
---|
697 | n/a | static int PTRCALL |
---|
698 | n/a | notation2(PROLOG_STATE *state, |
---|
699 | n/a | int tok, |
---|
700 | n/a | const char *ptr, |
---|
701 | n/a | const char *end, |
---|
702 | n/a | const ENCODING *enc) |
---|
703 | n/a | { |
---|
704 | n/a | switch (tok) { |
---|
705 | n/a | case XML_TOK_PROLOG_S: |
---|
706 | n/a | return XML_ROLE_NOTATION_NONE; |
---|
707 | n/a | case XML_TOK_LITERAL: |
---|
708 | n/a | state->handler = notation4; |
---|
709 | n/a | return XML_ROLE_NOTATION_PUBLIC_ID; |
---|
710 | n/a | } |
---|
711 | n/a | return common(state, tok); |
---|
712 | n/a | } |
---|
713 | n/a | |
---|
714 | n/a | static int PTRCALL |
---|
715 | n/a | notation3(PROLOG_STATE *state, |
---|
716 | n/a | int tok, |
---|
717 | n/a | const char *ptr, |
---|
718 | n/a | const char *end, |
---|
719 | n/a | const ENCODING *enc) |
---|
720 | n/a | { |
---|
721 | n/a | switch (tok) { |
---|
722 | n/a | case XML_TOK_PROLOG_S: |
---|
723 | n/a | return XML_ROLE_NOTATION_NONE; |
---|
724 | n/a | case XML_TOK_LITERAL: |
---|
725 | n/a | state->handler = declClose; |
---|
726 | n/a | state->role_none = XML_ROLE_NOTATION_NONE; |
---|
727 | n/a | return XML_ROLE_NOTATION_SYSTEM_ID; |
---|
728 | n/a | } |
---|
729 | n/a | return common(state, tok); |
---|
730 | n/a | } |
---|
731 | n/a | |
---|
732 | n/a | static int PTRCALL |
---|
733 | n/a | notation4(PROLOG_STATE *state, |
---|
734 | n/a | int tok, |
---|
735 | n/a | const char *ptr, |
---|
736 | n/a | const char *end, |
---|
737 | n/a | const ENCODING *enc) |
---|
738 | n/a | { |
---|
739 | n/a | switch (tok) { |
---|
740 | n/a | case XML_TOK_PROLOG_S: |
---|
741 | n/a | return XML_ROLE_NOTATION_NONE; |
---|
742 | n/a | case XML_TOK_LITERAL: |
---|
743 | n/a | state->handler = declClose; |
---|
744 | n/a | state->role_none = XML_ROLE_NOTATION_NONE; |
---|
745 | n/a | return XML_ROLE_NOTATION_SYSTEM_ID; |
---|
746 | n/a | case XML_TOK_DECL_CLOSE: |
---|
747 | n/a | setTopLevel(state); |
---|
748 | n/a | return XML_ROLE_NOTATION_NO_SYSTEM_ID; |
---|
749 | n/a | } |
---|
750 | n/a | return common(state, tok); |
---|
751 | n/a | } |
---|
752 | n/a | |
---|
753 | n/a | static int PTRCALL |
---|
754 | n/a | attlist0(PROLOG_STATE *state, |
---|
755 | n/a | int tok, |
---|
756 | n/a | const char *ptr, |
---|
757 | n/a | const char *end, |
---|
758 | n/a | const ENCODING *enc) |
---|
759 | n/a | { |
---|
760 | n/a | switch (tok) { |
---|
761 | n/a | case XML_TOK_PROLOG_S: |
---|
762 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
763 | n/a | case XML_TOK_NAME: |
---|
764 | n/a | case XML_TOK_PREFIXED_NAME: |
---|
765 | n/a | state->handler = attlist1; |
---|
766 | n/a | return XML_ROLE_ATTLIST_ELEMENT_NAME; |
---|
767 | n/a | } |
---|
768 | n/a | return common(state, tok); |
---|
769 | n/a | } |
---|
770 | n/a | |
---|
771 | n/a | static int PTRCALL |
---|
772 | n/a | attlist1(PROLOG_STATE *state, |
---|
773 | n/a | int tok, |
---|
774 | n/a | const char *ptr, |
---|
775 | n/a | const char *end, |
---|
776 | n/a | const ENCODING *enc) |
---|
777 | n/a | { |
---|
778 | n/a | switch (tok) { |
---|
779 | n/a | case XML_TOK_PROLOG_S: |
---|
780 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
781 | n/a | case XML_TOK_DECL_CLOSE: |
---|
782 | n/a | setTopLevel(state); |
---|
783 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
784 | n/a | case XML_TOK_NAME: |
---|
785 | n/a | case XML_TOK_PREFIXED_NAME: |
---|
786 | n/a | state->handler = attlist2; |
---|
787 | n/a | return XML_ROLE_ATTRIBUTE_NAME; |
---|
788 | n/a | } |
---|
789 | n/a | return common(state, tok); |
---|
790 | n/a | } |
---|
791 | n/a | |
---|
792 | n/a | static int PTRCALL |
---|
793 | n/a | attlist2(PROLOG_STATE *state, |
---|
794 | n/a | int tok, |
---|
795 | n/a | const char *ptr, |
---|
796 | n/a | const char *end, |
---|
797 | n/a | const ENCODING *enc) |
---|
798 | n/a | { |
---|
799 | n/a | switch (tok) { |
---|
800 | n/a | case XML_TOK_PROLOG_S: |
---|
801 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
802 | n/a | case XML_TOK_NAME: |
---|
803 | n/a | { |
---|
804 | n/a | static const char * const types[] = { |
---|
805 | n/a | KW_CDATA, |
---|
806 | n/a | KW_ID, |
---|
807 | n/a | KW_IDREF, |
---|
808 | n/a | KW_IDREFS, |
---|
809 | n/a | KW_ENTITY, |
---|
810 | n/a | KW_ENTITIES, |
---|
811 | n/a | KW_NMTOKEN, |
---|
812 | n/a | KW_NMTOKENS, |
---|
813 | n/a | }; |
---|
814 | n/a | int i; |
---|
815 | n/a | for (i = 0; i < (int)(sizeof(types)/sizeof(types[0])); i++) |
---|
816 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, types[i])) { |
---|
817 | n/a | state->handler = attlist8; |
---|
818 | n/a | return XML_ROLE_ATTRIBUTE_TYPE_CDATA + i; |
---|
819 | n/a | } |
---|
820 | n/a | } |
---|
821 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_NOTATION)) { |
---|
822 | n/a | state->handler = attlist5; |
---|
823 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
824 | n/a | } |
---|
825 | n/a | break; |
---|
826 | n/a | case XML_TOK_OPEN_PAREN: |
---|
827 | n/a | state->handler = attlist3; |
---|
828 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
829 | n/a | } |
---|
830 | n/a | return common(state, tok); |
---|
831 | n/a | } |
---|
832 | n/a | |
---|
833 | n/a | static int PTRCALL |
---|
834 | n/a | attlist3(PROLOG_STATE *state, |
---|
835 | n/a | int tok, |
---|
836 | n/a | const char *ptr, |
---|
837 | n/a | const char *end, |
---|
838 | n/a | const ENCODING *enc) |
---|
839 | n/a | { |
---|
840 | n/a | switch (tok) { |
---|
841 | n/a | case XML_TOK_PROLOG_S: |
---|
842 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
843 | n/a | case XML_TOK_NMTOKEN: |
---|
844 | n/a | case XML_TOK_NAME: |
---|
845 | n/a | case XML_TOK_PREFIXED_NAME: |
---|
846 | n/a | state->handler = attlist4; |
---|
847 | n/a | return XML_ROLE_ATTRIBUTE_ENUM_VALUE; |
---|
848 | n/a | } |
---|
849 | n/a | return common(state, tok); |
---|
850 | n/a | } |
---|
851 | n/a | |
---|
852 | n/a | static int PTRCALL |
---|
853 | n/a | attlist4(PROLOG_STATE *state, |
---|
854 | n/a | int tok, |
---|
855 | n/a | const char *ptr, |
---|
856 | n/a | const char *end, |
---|
857 | n/a | const ENCODING *enc) |
---|
858 | n/a | { |
---|
859 | n/a | switch (tok) { |
---|
860 | n/a | case XML_TOK_PROLOG_S: |
---|
861 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
862 | n/a | case XML_TOK_CLOSE_PAREN: |
---|
863 | n/a | state->handler = attlist8; |
---|
864 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
865 | n/a | case XML_TOK_OR: |
---|
866 | n/a | state->handler = attlist3; |
---|
867 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
868 | n/a | } |
---|
869 | n/a | return common(state, tok); |
---|
870 | n/a | } |
---|
871 | n/a | |
---|
872 | n/a | static int PTRCALL |
---|
873 | n/a | attlist5(PROLOG_STATE *state, |
---|
874 | n/a | int tok, |
---|
875 | n/a | const char *ptr, |
---|
876 | n/a | const char *end, |
---|
877 | n/a | const ENCODING *enc) |
---|
878 | n/a | { |
---|
879 | n/a | switch (tok) { |
---|
880 | n/a | case XML_TOK_PROLOG_S: |
---|
881 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
882 | n/a | case XML_TOK_OPEN_PAREN: |
---|
883 | n/a | state->handler = attlist6; |
---|
884 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
885 | n/a | } |
---|
886 | n/a | return common(state, tok); |
---|
887 | n/a | } |
---|
888 | n/a | |
---|
889 | n/a | static int PTRCALL |
---|
890 | n/a | attlist6(PROLOG_STATE *state, |
---|
891 | n/a | int tok, |
---|
892 | n/a | const char *ptr, |
---|
893 | n/a | const char *end, |
---|
894 | n/a | const ENCODING *enc) |
---|
895 | n/a | { |
---|
896 | n/a | switch (tok) { |
---|
897 | n/a | case XML_TOK_PROLOG_S: |
---|
898 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
899 | n/a | case XML_TOK_NAME: |
---|
900 | n/a | state->handler = attlist7; |
---|
901 | n/a | return XML_ROLE_ATTRIBUTE_NOTATION_VALUE; |
---|
902 | n/a | } |
---|
903 | n/a | return common(state, tok); |
---|
904 | n/a | } |
---|
905 | n/a | |
---|
906 | n/a | static int PTRCALL |
---|
907 | n/a | attlist7(PROLOG_STATE *state, |
---|
908 | n/a | int tok, |
---|
909 | n/a | const char *ptr, |
---|
910 | n/a | const char *end, |
---|
911 | n/a | const ENCODING *enc) |
---|
912 | n/a | { |
---|
913 | n/a | switch (tok) { |
---|
914 | n/a | case XML_TOK_PROLOG_S: |
---|
915 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
916 | n/a | case XML_TOK_CLOSE_PAREN: |
---|
917 | n/a | state->handler = attlist8; |
---|
918 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
919 | n/a | case XML_TOK_OR: |
---|
920 | n/a | state->handler = attlist6; |
---|
921 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
922 | n/a | } |
---|
923 | n/a | return common(state, tok); |
---|
924 | n/a | } |
---|
925 | n/a | |
---|
926 | n/a | /* default value */ |
---|
927 | n/a | static int PTRCALL |
---|
928 | n/a | attlist8(PROLOG_STATE *state, |
---|
929 | n/a | int tok, |
---|
930 | n/a | const char *ptr, |
---|
931 | n/a | const char *end, |
---|
932 | n/a | const ENCODING *enc) |
---|
933 | n/a | { |
---|
934 | n/a | switch (tok) { |
---|
935 | n/a | case XML_TOK_PROLOG_S: |
---|
936 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
937 | n/a | case XML_TOK_POUND_NAME: |
---|
938 | n/a | if (XmlNameMatchesAscii(enc, |
---|
939 | n/a | ptr + MIN_BYTES_PER_CHAR(enc), |
---|
940 | n/a | end, |
---|
941 | n/a | KW_IMPLIED)) { |
---|
942 | n/a | state->handler = attlist1; |
---|
943 | n/a | return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE; |
---|
944 | n/a | } |
---|
945 | n/a | if (XmlNameMatchesAscii(enc, |
---|
946 | n/a | ptr + MIN_BYTES_PER_CHAR(enc), |
---|
947 | n/a | end, |
---|
948 | n/a | KW_REQUIRED)) { |
---|
949 | n/a | state->handler = attlist1; |
---|
950 | n/a | return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE; |
---|
951 | n/a | } |
---|
952 | n/a | if (XmlNameMatchesAscii(enc, |
---|
953 | n/a | ptr + MIN_BYTES_PER_CHAR(enc), |
---|
954 | n/a | end, |
---|
955 | n/a | KW_FIXED)) { |
---|
956 | n/a | state->handler = attlist9; |
---|
957 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
958 | n/a | } |
---|
959 | n/a | break; |
---|
960 | n/a | case XML_TOK_LITERAL: |
---|
961 | n/a | state->handler = attlist1; |
---|
962 | n/a | return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE; |
---|
963 | n/a | } |
---|
964 | n/a | return common(state, tok); |
---|
965 | n/a | } |
---|
966 | n/a | |
---|
967 | n/a | static int PTRCALL |
---|
968 | n/a | attlist9(PROLOG_STATE *state, |
---|
969 | n/a | int tok, |
---|
970 | n/a | const char *ptr, |
---|
971 | n/a | const char *end, |
---|
972 | n/a | const ENCODING *enc) |
---|
973 | n/a | { |
---|
974 | n/a | switch (tok) { |
---|
975 | n/a | case XML_TOK_PROLOG_S: |
---|
976 | n/a | return XML_ROLE_ATTLIST_NONE; |
---|
977 | n/a | case XML_TOK_LITERAL: |
---|
978 | n/a | state->handler = attlist1; |
---|
979 | n/a | return XML_ROLE_FIXED_ATTRIBUTE_VALUE; |
---|
980 | n/a | } |
---|
981 | n/a | return common(state, tok); |
---|
982 | n/a | } |
---|
983 | n/a | |
---|
984 | n/a | static int PTRCALL |
---|
985 | n/a | element0(PROLOG_STATE *state, |
---|
986 | n/a | int tok, |
---|
987 | n/a | const char *ptr, |
---|
988 | n/a | const char *end, |
---|
989 | n/a | const ENCODING *enc) |
---|
990 | n/a | { |
---|
991 | n/a | switch (tok) { |
---|
992 | n/a | case XML_TOK_PROLOG_S: |
---|
993 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
994 | n/a | case XML_TOK_NAME: |
---|
995 | n/a | case XML_TOK_PREFIXED_NAME: |
---|
996 | n/a | state->handler = element1; |
---|
997 | n/a | return XML_ROLE_ELEMENT_NAME; |
---|
998 | n/a | } |
---|
999 | n/a | return common(state, tok); |
---|
1000 | n/a | } |
---|
1001 | n/a | |
---|
1002 | n/a | static int PTRCALL |
---|
1003 | n/a | element1(PROLOG_STATE *state, |
---|
1004 | n/a | int tok, |
---|
1005 | n/a | const char *ptr, |
---|
1006 | n/a | const char *end, |
---|
1007 | n/a | const ENCODING *enc) |
---|
1008 | n/a | { |
---|
1009 | n/a | switch (tok) { |
---|
1010 | n/a | case XML_TOK_PROLOG_S: |
---|
1011 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
1012 | n/a | case XML_TOK_NAME: |
---|
1013 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_EMPTY)) { |
---|
1014 | n/a | state->handler = declClose; |
---|
1015 | n/a | state->role_none = XML_ROLE_ELEMENT_NONE; |
---|
1016 | n/a | return XML_ROLE_CONTENT_EMPTY; |
---|
1017 | n/a | } |
---|
1018 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_ANY)) { |
---|
1019 | n/a | state->handler = declClose; |
---|
1020 | n/a | state->role_none = XML_ROLE_ELEMENT_NONE; |
---|
1021 | n/a | return XML_ROLE_CONTENT_ANY; |
---|
1022 | n/a | } |
---|
1023 | n/a | break; |
---|
1024 | n/a | case XML_TOK_OPEN_PAREN: |
---|
1025 | n/a | state->handler = element2; |
---|
1026 | n/a | state->level = 1; |
---|
1027 | n/a | return XML_ROLE_GROUP_OPEN; |
---|
1028 | n/a | } |
---|
1029 | n/a | return common(state, tok); |
---|
1030 | n/a | } |
---|
1031 | n/a | |
---|
1032 | n/a | static int PTRCALL |
---|
1033 | n/a | element2(PROLOG_STATE *state, |
---|
1034 | n/a | int tok, |
---|
1035 | n/a | const char *ptr, |
---|
1036 | n/a | const char *end, |
---|
1037 | n/a | const ENCODING *enc) |
---|
1038 | n/a | { |
---|
1039 | n/a | switch (tok) { |
---|
1040 | n/a | case XML_TOK_PROLOG_S: |
---|
1041 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
1042 | n/a | case XML_TOK_POUND_NAME: |
---|
1043 | n/a | if (XmlNameMatchesAscii(enc, |
---|
1044 | n/a | ptr + MIN_BYTES_PER_CHAR(enc), |
---|
1045 | n/a | end, |
---|
1046 | n/a | KW_PCDATA)) { |
---|
1047 | n/a | state->handler = element3; |
---|
1048 | n/a | return XML_ROLE_CONTENT_PCDATA; |
---|
1049 | n/a | } |
---|
1050 | n/a | break; |
---|
1051 | n/a | case XML_TOK_OPEN_PAREN: |
---|
1052 | n/a | state->level = 2; |
---|
1053 | n/a | state->handler = element6; |
---|
1054 | n/a | return XML_ROLE_GROUP_OPEN; |
---|
1055 | n/a | case XML_TOK_NAME: |
---|
1056 | n/a | case XML_TOK_PREFIXED_NAME: |
---|
1057 | n/a | state->handler = element7; |
---|
1058 | n/a | return XML_ROLE_CONTENT_ELEMENT; |
---|
1059 | n/a | case XML_TOK_NAME_QUESTION: |
---|
1060 | n/a | state->handler = element7; |
---|
1061 | n/a | return XML_ROLE_CONTENT_ELEMENT_OPT; |
---|
1062 | n/a | case XML_TOK_NAME_ASTERISK: |
---|
1063 | n/a | state->handler = element7; |
---|
1064 | n/a | return XML_ROLE_CONTENT_ELEMENT_REP; |
---|
1065 | n/a | case XML_TOK_NAME_PLUS: |
---|
1066 | n/a | state->handler = element7; |
---|
1067 | n/a | return XML_ROLE_CONTENT_ELEMENT_PLUS; |
---|
1068 | n/a | } |
---|
1069 | n/a | return common(state, tok); |
---|
1070 | n/a | } |
---|
1071 | n/a | |
---|
1072 | n/a | static int PTRCALL |
---|
1073 | n/a | element3(PROLOG_STATE *state, |
---|
1074 | n/a | int tok, |
---|
1075 | n/a | const char *ptr, |
---|
1076 | n/a | const char *end, |
---|
1077 | n/a | const ENCODING *enc) |
---|
1078 | n/a | { |
---|
1079 | n/a | switch (tok) { |
---|
1080 | n/a | case XML_TOK_PROLOG_S: |
---|
1081 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
1082 | n/a | case XML_TOK_CLOSE_PAREN: |
---|
1083 | n/a | state->handler = declClose; |
---|
1084 | n/a | state->role_none = XML_ROLE_ELEMENT_NONE; |
---|
1085 | n/a | return XML_ROLE_GROUP_CLOSE; |
---|
1086 | n/a | case XML_TOK_CLOSE_PAREN_ASTERISK: |
---|
1087 | n/a | state->handler = declClose; |
---|
1088 | n/a | state->role_none = XML_ROLE_ELEMENT_NONE; |
---|
1089 | n/a | return XML_ROLE_GROUP_CLOSE_REP; |
---|
1090 | n/a | case XML_TOK_OR: |
---|
1091 | n/a | state->handler = element4; |
---|
1092 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
1093 | n/a | } |
---|
1094 | n/a | return common(state, tok); |
---|
1095 | n/a | } |
---|
1096 | n/a | |
---|
1097 | n/a | static int PTRCALL |
---|
1098 | n/a | element4(PROLOG_STATE *state, |
---|
1099 | n/a | int tok, |
---|
1100 | n/a | const char *ptr, |
---|
1101 | n/a | const char *end, |
---|
1102 | n/a | const ENCODING *enc) |
---|
1103 | n/a | { |
---|
1104 | n/a | switch (tok) { |
---|
1105 | n/a | case XML_TOK_PROLOG_S: |
---|
1106 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
1107 | n/a | case XML_TOK_NAME: |
---|
1108 | n/a | case XML_TOK_PREFIXED_NAME: |
---|
1109 | n/a | state->handler = element5; |
---|
1110 | n/a | return XML_ROLE_CONTENT_ELEMENT; |
---|
1111 | n/a | } |
---|
1112 | n/a | return common(state, tok); |
---|
1113 | n/a | } |
---|
1114 | n/a | |
---|
1115 | n/a | static int PTRCALL |
---|
1116 | n/a | element5(PROLOG_STATE *state, |
---|
1117 | n/a | int tok, |
---|
1118 | n/a | const char *ptr, |
---|
1119 | n/a | const char *end, |
---|
1120 | n/a | const ENCODING *enc) |
---|
1121 | n/a | { |
---|
1122 | n/a | switch (tok) { |
---|
1123 | n/a | case XML_TOK_PROLOG_S: |
---|
1124 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
1125 | n/a | case XML_TOK_CLOSE_PAREN_ASTERISK: |
---|
1126 | n/a | state->handler = declClose; |
---|
1127 | n/a | state->role_none = XML_ROLE_ELEMENT_NONE; |
---|
1128 | n/a | return XML_ROLE_GROUP_CLOSE_REP; |
---|
1129 | n/a | case XML_TOK_OR: |
---|
1130 | n/a | state->handler = element4; |
---|
1131 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
1132 | n/a | } |
---|
1133 | n/a | return common(state, tok); |
---|
1134 | n/a | } |
---|
1135 | n/a | |
---|
1136 | n/a | static int PTRCALL |
---|
1137 | n/a | element6(PROLOG_STATE *state, |
---|
1138 | n/a | int tok, |
---|
1139 | n/a | const char *ptr, |
---|
1140 | n/a | const char *end, |
---|
1141 | n/a | const ENCODING *enc) |
---|
1142 | n/a | { |
---|
1143 | n/a | switch (tok) { |
---|
1144 | n/a | case XML_TOK_PROLOG_S: |
---|
1145 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
1146 | n/a | case XML_TOK_OPEN_PAREN: |
---|
1147 | n/a | state->level += 1; |
---|
1148 | n/a | return XML_ROLE_GROUP_OPEN; |
---|
1149 | n/a | case XML_TOK_NAME: |
---|
1150 | n/a | case XML_TOK_PREFIXED_NAME: |
---|
1151 | n/a | state->handler = element7; |
---|
1152 | n/a | return XML_ROLE_CONTENT_ELEMENT; |
---|
1153 | n/a | case XML_TOK_NAME_QUESTION: |
---|
1154 | n/a | state->handler = element7; |
---|
1155 | n/a | return XML_ROLE_CONTENT_ELEMENT_OPT; |
---|
1156 | n/a | case XML_TOK_NAME_ASTERISK: |
---|
1157 | n/a | state->handler = element7; |
---|
1158 | n/a | return XML_ROLE_CONTENT_ELEMENT_REP; |
---|
1159 | n/a | case XML_TOK_NAME_PLUS: |
---|
1160 | n/a | state->handler = element7; |
---|
1161 | n/a | return XML_ROLE_CONTENT_ELEMENT_PLUS; |
---|
1162 | n/a | } |
---|
1163 | n/a | return common(state, tok); |
---|
1164 | n/a | } |
---|
1165 | n/a | |
---|
1166 | n/a | static int PTRCALL |
---|
1167 | n/a | element7(PROLOG_STATE *state, |
---|
1168 | n/a | int tok, |
---|
1169 | n/a | const char *ptr, |
---|
1170 | n/a | const char *end, |
---|
1171 | n/a | const ENCODING *enc) |
---|
1172 | n/a | { |
---|
1173 | n/a | switch (tok) { |
---|
1174 | n/a | case XML_TOK_PROLOG_S: |
---|
1175 | n/a | return XML_ROLE_ELEMENT_NONE; |
---|
1176 | n/a | case XML_TOK_CLOSE_PAREN: |
---|
1177 | n/a | state->level -= 1; |
---|
1178 | n/a | if (state->level == 0) { |
---|
1179 | n/a | state->handler = declClose; |
---|
1180 | n/a | state->role_none = XML_ROLE_ELEMENT_NONE; |
---|
1181 | n/a | } |
---|
1182 | n/a | return XML_ROLE_GROUP_CLOSE; |
---|
1183 | n/a | case XML_TOK_CLOSE_PAREN_ASTERISK: |
---|
1184 | n/a | state->level -= 1; |
---|
1185 | n/a | if (state->level == 0) { |
---|
1186 | n/a | state->handler = declClose; |
---|
1187 | n/a | state->role_none = XML_ROLE_ELEMENT_NONE; |
---|
1188 | n/a | } |
---|
1189 | n/a | return XML_ROLE_GROUP_CLOSE_REP; |
---|
1190 | n/a | case XML_TOK_CLOSE_PAREN_QUESTION: |
---|
1191 | n/a | state->level -= 1; |
---|
1192 | n/a | if (state->level == 0) { |
---|
1193 | n/a | state->handler = declClose; |
---|
1194 | n/a | state->role_none = XML_ROLE_ELEMENT_NONE; |
---|
1195 | n/a | } |
---|
1196 | n/a | return XML_ROLE_GROUP_CLOSE_OPT; |
---|
1197 | n/a | case XML_TOK_CLOSE_PAREN_PLUS: |
---|
1198 | n/a | state->level -= 1; |
---|
1199 | n/a | if (state->level == 0) { |
---|
1200 | n/a | state->handler = declClose; |
---|
1201 | n/a | state->role_none = XML_ROLE_ELEMENT_NONE; |
---|
1202 | n/a | } |
---|
1203 | n/a | return XML_ROLE_GROUP_CLOSE_PLUS; |
---|
1204 | n/a | case XML_TOK_COMMA: |
---|
1205 | n/a | state->handler = element6; |
---|
1206 | n/a | return XML_ROLE_GROUP_SEQUENCE; |
---|
1207 | n/a | case XML_TOK_OR: |
---|
1208 | n/a | state->handler = element6; |
---|
1209 | n/a | return XML_ROLE_GROUP_CHOICE; |
---|
1210 | n/a | } |
---|
1211 | n/a | return common(state, tok); |
---|
1212 | n/a | } |
---|
1213 | n/a | |
---|
1214 | n/a | #ifdef XML_DTD |
---|
1215 | n/a | |
---|
1216 | n/a | static int PTRCALL |
---|
1217 | n/a | condSect0(PROLOG_STATE *state, |
---|
1218 | n/a | int tok, |
---|
1219 | n/a | const char *ptr, |
---|
1220 | n/a | const char *end, |
---|
1221 | n/a | const ENCODING *enc) |
---|
1222 | n/a | { |
---|
1223 | n/a | switch (tok) { |
---|
1224 | n/a | case XML_TOK_PROLOG_S: |
---|
1225 | n/a | return XML_ROLE_NONE; |
---|
1226 | n/a | case XML_TOK_NAME: |
---|
1227 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_INCLUDE)) { |
---|
1228 | n/a | state->handler = condSect1; |
---|
1229 | n/a | return XML_ROLE_NONE; |
---|
1230 | n/a | } |
---|
1231 | n/a | if (XmlNameMatchesAscii(enc, ptr, end, KW_IGNORE)) { |
---|
1232 | n/a | state->handler = condSect2; |
---|
1233 | n/a | return XML_ROLE_NONE; |
---|
1234 | n/a | } |
---|
1235 | n/a | break; |
---|
1236 | n/a | } |
---|
1237 | n/a | return common(state, tok); |
---|
1238 | n/a | } |
---|
1239 | n/a | |
---|
1240 | n/a | static int PTRCALL |
---|
1241 | n/a | condSect1(PROLOG_STATE *state, |
---|
1242 | n/a | int tok, |
---|
1243 | n/a | const char *ptr, |
---|
1244 | n/a | const char *end, |
---|
1245 | n/a | const ENCODING *enc) |
---|
1246 | n/a | { |
---|
1247 | n/a | switch (tok) { |
---|
1248 | n/a | case XML_TOK_PROLOG_S: |
---|
1249 | n/a | return XML_ROLE_NONE; |
---|
1250 | n/a | case XML_TOK_OPEN_BRACKET: |
---|
1251 | n/a | state->handler = externalSubset1; |
---|
1252 | n/a | state->includeLevel += 1; |
---|
1253 | n/a | return XML_ROLE_NONE; |
---|
1254 | n/a | } |
---|
1255 | n/a | return common(state, tok); |
---|
1256 | n/a | } |
---|
1257 | n/a | |
---|
1258 | n/a | static int PTRCALL |
---|
1259 | n/a | condSect2(PROLOG_STATE *state, |
---|
1260 | n/a | int tok, |
---|
1261 | n/a | const char *ptr, |
---|
1262 | n/a | const char *end, |
---|
1263 | n/a | const ENCODING *enc) |
---|
1264 | n/a | { |
---|
1265 | n/a | switch (tok) { |
---|
1266 | n/a | case XML_TOK_PROLOG_S: |
---|
1267 | n/a | return XML_ROLE_NONE; |
---|
1268 | n/a | case XML_TOK_OPEN_BRACKET: |
---|
1269 | n/a | state->handler = externalSubset1; |
---|
1270 | n/a | return XML_ROLE_IGNORE_SECT; |
---|
1271 | n/a | } |
---|
1272 | n/a | return common(state, tok); |
---|
1273 | n/a | } |
---|
1274 | n/a | |
---|
1275 | n/a | #endif /* XML_DTD */ |
---|
1276 | n/a | |
---|
1277 | n/a | static int PTRCALL |
---|
1278 | n/a | declClose(PROLOG_STATE *state, |
---|
1279 | n/a | int tok, |
---|
1280 | n/a | const char *ptr, |
---|
1281 | n/a | const char *end, |
---|
1282 | n/a | const ENCODING *enc) |
---|
1283 | n/a | { |
---|
1284 | n/a | switch (tok) { |
---|
1285 | n/a | case XML_TOK_PROLOG_S: |
---|
1286 | n/a | return state->role_none; |
---|
1287 | n/a | case XML_TOK_DECL_CLOSE: |
---|
1288 | n/a | setTopLevel(state); |
---|
1289 | n/a | return state->role_none; |
---|
1290 | n/a | } |
---|
1291 | n/a | return common(state, tok); |
---|
1292 | n/a | } |
---|
1293 | n/a | |
---|
1294 | n/a | static int PTRCALL |
---|
1295 | n/a | error(PROLOG_STATE *state, |
---|
1296 | n/a | int tok, |
---|
1297 | n/a | const char *ptr, |
---|
1298 | n/a | const char *end, |
---|
1299 | n/a | const ENCODING *enc) |
---|
1300 | n/a | { |
---|
1301 | n/a | return XML_ROLE_NONE; |
---|
1302 | n/a | } |
---|
1303 | n/a | |
---|
1304 | n/a | static int FASTCALL |
---|
1305 | n/a | common(PROLOG_STATE *state, int tok) |
---|
1306 | n/a | { |
---|
1307 | n/a | #ifdef XML_DTD |
---|
1308 | n/a | if (!state->documentEntity && tok == XML_TOK_PARAM_ENTITY_REF) |
---|
1309 | n/a | return XML_ROLE_INNER_PARAM_ENTITY_REF; |
---|
1310 | n/a | #endif |
---|
1311 | n/a | state->handler = error; |
---|
1312 | n/a | return XML_ROLE_ERROR; |
---|
1313 | n/a | } |
---|
1314 | n/a | |
---|
1315 | n/a | void |
---|
1316 | n/a | XmlPrologStateInit(PROLOG_STATE *state) |
---|
1317 | n/a | { |
---|
1318 | n/a | state->handler = prolog0; |
---|
1319 | n/a | #ifdef XML_DTD |
---|
1320 | n/a | state->documentEntity = 1; |
---|
1321 | n/a | state->includeLevel = 0; |
---|
1322 | n/a | state->inEntityValue = 0; |
---|
1323 | n/a | #endif /* XML_DTD */ |
---|
1324 | n/a | } |
---|
1325 | n/a | |
---|
1326 | n/a | #ifdef XML_DTD |
---|
1327 | n/a | |
---|
1328 | n/a | void |
---|
1329 | n/a | XmlPrologStateInitExternalEntity(PROLOG_STATE *state) |
---|
1330 | n/a | { |
---|
1331 | n/a | state->handler = externalSubset0; |
---|
1332 | n/a | state->documentEntity = 0; |
---|
1333 | n/a | state->includeLevel = 0; |
---|
1334 | n/a | } |
---|
1335 | n/a | |
---|
1336 | n/a | #endif /* XML_DTD */ |
---|