| 15 Portions created by James Clark are Copyright (C) 1998, 1999 |
15 Portions created by James Clark are Copyright (C) 1998, 1999 |
| 16 James Clark. All Rights Reserved. |
16 James Clark. All Rights Reserved. |
| 17 |
17 |
| 18 Contributor(s): |
18 Contributor(s): |
| 19 |
19 |
| 20 Alternatively, the contents of this file may be used under the terms |
|
| 21 of the GNU General Public License (the "GPL"), in which case the |
|
| 22 provisions of the GPL are applicable instead of those above. If you |
|
| 23 wish to allow use of your version of this file only under the terms of |
|
| 24 the GPL and not to allow others to use your version of this file under |
|
| 25 the MPL, indicate your decision by deleting the provisions above and |
|
| 26 replace them with the notice and other provisions required by the |
|
| 27 GPL. If you do not delete the provisions above, a recipient may use |
|
| 28 your version of this file under either the MPL or the GPL. |
|
| 29 */ |
20 */ |
| 30 |
21 |
| 31 #include "xmldef.h" |
22 #include "xmldef.h" |
| 32 #include "xmlparse.h" |
23 #include "xmlparse.h" |
| 33 |
24 |
| 188 static Processor prologProcessor; |
179 static Processor prologProcessor; |
| 189 static Processor prologInitProcessor; |
180 static Processor prologInitProcessor; |
| 190 static Processor contentProcessor; |
181 static Processor contentProcessor; |
| 191 static Processor cdataSectionProcessor; |
182 static Processor cdataSectionProcessor; |
| 192 static Processor epilogProcessor; |
183 static Processor epilogProcessor; |
| 193 static Processor errorProcessor; |
|
| 194 static Processor externalEntityInitProcessor; |
184 static Processor externalEntityInitProcessor; |
| 195 static Processor externalEntityInitProcessor2; |
185 static Processor externalEntityInitProcessor2; |
| 196 static Processor externalEntityInitProcessor3; |
186 static Processor externalEntityInitProcessor3; |
| 197 static Processor externalEntityContentProcessor; |
187 static Processor externalEntityContentProcessor; |
| 198 |
188 |
| 2331 } |
2321 } |
| 2332 eventPtr = s = next; |
2322 eventPtr = s = next; |
| 2333 } |
2323 } |
| 2334 } |
2324 } |
| 2335 |
2325 |
| 2336 static |
|
| 2337 enum XML_Error errorProcessor(XML_Parser parser, |
|
| 2338 const char *s, |
|
| 2339 const char *end, |
|
| 2340 const char **nextPtr) |
|
| 2341 { |
|
| 2342 return errorCode; |
|
| 2343 } |
|
| 2344 |
|
| 2345 static enum XML_Error |
2326 static enum XML_Error |
| 2346 storeAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata, |
2327 storeAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata, |
| 2347 const char *ptr, const char *end, |
2328 const char *ptr, const char *end, |
| 2348 STRING_POOL *pool) |
2329 STRING_POOL *pool) |
| 2349 { |
2330 { |
| 2481 static |
2462 static |
| 2482 enum XML_Error storeEntityValue(XML_Parser parser, |
2463 enum XML_Error storeEntityValue(XML_Parser parser, |
| 2483 const char *entityTextPtr, |
2464 const char *entityTextPtr, |
| 2484 const char *entityTextEnd) |
2465 const char *entityTextEnd) |
| 2485 { |
2466 { |
| 2486 const ENCODING *internalEnc = ns ? XmlGetInternalEncodingNS() : XmlGetInternalEncoding(); |
2467 const ENCODING *internalEnc; |
| 2487 STRING_POOL *pool = &(dtd.pool); |
2468 STRING_POOL *pool = &(dtd.pool); |
| 2488 entityTextPtr += encoding->minBytesPerChar; |
2469 entityTextPtr += encoding->minBytesPerChar; |
| 2489 entityTextEnd -= encoding->minBytesPerChar; |
2470 entityTextEnd -= encoding->minBytesPerChar; |
| |
2471 internalEnc = ns ? XmlGetInternalEncodingNS() : XmlGetInternalEncoding(); |
| 2490 for (;;) { |
2472 for (;;) { |
| 2491 const char *next; |
2473 const char *next; |
| 2492 int tok = XmlEntityValueTok(encoding, entityTextPtr, entityTextEnd, &next); |
2474 int tok = XmlEntityValueTok(encoding, entityTextPtr, entityTextEnd, &next); |
| 2493 switch (tok) { |
2475 switch (tok) { |
| 2494 case XML_TOK_PARAM_ENTITY_REF: |
2476 case XML_TOK_PARAM_ENTITY_REF: |