35#pragma convert("ISO8859-1")
42#define XML_DIR_SEP '\\'
44#define XML_DIR_SEP '/'
66#ifdef LIBXML_CATALOG_ENABLED
69#ifdef LIBXML_SCHEMAS_ENABLED
105#define XML_MAX_HUGE_LENGTH 1000000000
107#define XML_PARSER_BIG_ENTITY 1000
108#define XML_PARSER_LOT_ENTITY 5000
116#define XML_PARSER_NON_LINEAR 10
146 unsigned long oldnbent = ctxt->
nbentities, diff;
192 if (replacement != 0) {
209 }
else if (
size != 0) {
228 }
else if (ent !=
NULL) {
275#define XML_PARSER_BIG_BUFFER_SIZE 300
276#define XML_PARSER_BUFFER_SIZE 100
277#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
288#define XML_PARSER_CHUNK_SIZE 100
314#ifdef LIBXML_LEGACY_ENABLED
354 (
const char *) localname,
NULL,
NULL, 0, 0,
355 "Attribute %s redefined\n", localname);
359 (
const char *) prefix, (
const char *) localname,
360 NULL, 0, 0,
"Attribute %s:%s redefined\n", prefix,
387 errmsg =
"CharRef: invalid hexadecimal value";
390 errmsg =
"CharRef: invalid decimal value";
393 errmsg =
"CharRef: invalid value";
396 errmsg =
"internal error";
399 errmsg =
"PEReference at end of document";
402 errmsg =
"PEReference in prolog";
405 errmsg =
"PEReference in epilog";
408 errmsg =
"PEReference: no name";
411 errmsg =
"PEReference: expecting ';'";
414 errmsg =
"Detected an entity reference loop";
417 errmsg =
"EntityValue: \" or ' expected";
420 errmsg =
"PEReferences forbidden in internal subset";
423 errmsg =
"EntityValue: \" or ' expected";
426 errmsg =
"AttValue: \" or ' expected";
429 errmsg =
"Unescaped '<' not allowed in attributes values";
432 errmsg =
"SystemLiteral \" or ' expected";
435 errmsg =
"Unfinished System or Public ID \" or ' expected";
438 errmsg =
"Sequence ']]>' not allowed in content";
441 errmsg =
"SYSTEM or PUBLIC, the URI is missing";
444 errmsg =
"PUBLIC, the Public Identifier is missing";
447 errmsg =
"Comment must not contain '--' (double-hyphen)";
450 errmsg =
"xmlParsePI : no target name";
453 errmsg =
"Invalid PI name";
456 errmsg =
"NOTATION: Name expected here";
459 errmsg =
"'>' required to close NOTATION declaration";
462 errmsg =
"Entity value required";
465 errmsg =
"Fragment not allowed";
468 errmsg =
"'(' required to start ATTLIST enumeration";
471 errmsg =
"NmToken expected in ATTLIST enumeration";
474 errmsg =
"')' required to finish ATTLIST enumeration";
477 errmsg =
"MixedContentDecl : '|' or ')*' expected";
480 errmsg =
"MixedContentDecl : '#PCDATA' expected";
483 errmsg =
"ContentDecl : Name or '(' expected";
486 errmsg =
"ContentDecl : ',' '|' or ')' expected";
490 "PEReference: forbidden within markup decl in internal subset";
496 errmsg =
"XML conditional section '[' expected";
499 errmsg =
"Content error in the external subset";
503 "conditional section INCLUDE or IGNORE keyword expected";
506 errmsg =
"XML conditional section not closed";
509 errmsg =
"Text declaration '<?xml' required";
512 errmsg =
"parsing XML declaration: '?>' expected";
515 errmsg =
"external parsed entities cannot be standalone";
518 errmsg =
"EntityRef: expecting ';'";
521 errmsg =
"DOCTYPE improperly terminated";
524 errmsg =
"EndTag: '</' not found";
530 errmsg =
"String not closed expecting \" or '";
533 errmsg =
"String not started expecting ' or \"";
536 errmsg =
"Invalid XML encoding name";
539 errmsg =
"standalone accepts only 'yes' or 'no'";
542 errmsg =
"Document is empty";
545 errmsg =
"Extra content at the end of the document";
548 errmsg =
"chunk is not well balanced";
551 errmsg =
"extra content at the end of well balanced chunk";
554 errmsg =
"Malformed declaration expecting version";
565 errmsg =
"Unregistered error message";
597 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
605 ctxt->wellFormed = 0;
606 if (ctxt->recovery == 0)
607 ctxt->disableSAX = 1;
627 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
630 if ((ctxt !=
NULL) && (ctxt->sax !=
NULL) &&
632 schannel = ctxt->sax->serror;
634 __xmlRaiseError(schannel,
635 (ctxt->sax) ? ctxt->sax->warning :
NULL,
639 (
const char *) str1, (
const char *) str2,
NULL, 0, 0,
640 msg, (
const char *) str1, (
const char *) str2);
642 __xmlRaiseError(schannel,
NULL,
NULL,
645 (
const char *) str1, (
const char *) str2,
NULL, 0, 0,
646 msg, (
const char *) str1, (
const char *) str2);
665 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
671 schannel = ctxt->sax->serror;
674 __xmlRaiseError(schannel,
675 ctxt->vctxt.error, ctxt->vctxt.userData,
678 (
const char *) str2,
NULL, 0, 0,
679 msg, (
const char *) str1, (
const char *) str2);
682 __xmlRaiseError(schannel,
NULL,
NULL,
685 (
const char *) str2,
NULL, 0, 0,
686 msg, (
const char *) str1, (
const char *) str2);
703 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
712 ctxt->wellFormed = 0;
713 if (ctxt->recovery == 0)
714 ctxt->disableSAX = 1;
734 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
741 NULL, 0, (
const char *) str1, (
const char *) str2,
744 ctxt->wellFormed = 0;
745 if (ctxt->recovery == 0)
746 ctxt->disableSAX = 1;
763 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
773 ctxt->wellFormed = 0;
774 if (ctxt->recovery == 0)
775 ctxt->disableSAX = 1;
792 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
819 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
826 (
const char *) info2, (
const char *) info3, 0, 0,
msg,
827 info1, info2, info3);
829 ctxt->nsWellFormed = 0;
848 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
853 (
const char *) info2, (
const char *) info3, 0, 0,
msg,
854 info1, info2, info3);
878#ifdef LIBXML_THREAD_ENABLED
884#ifdef LIBXML_TREE_ENABLED
890#ifdef LIBXML_OUTPUT_ENABLED
896#ifdef LIBXML_PUSH_ENABLED
902#ifdef LIBXML_READER_ENABLED
908#ifdef LIBXML_PATTERN_ENABLED
914#ifdef LIBXML_WRITER_ENABLED
920#ifdef LIBXML_SAX1_ENABLED
926#ifdef LIBXML_FTP_ENABLED
932#ifdef LIBXML_HTTP_ENABLED
938#ifdef LIBXML_VALID_ENABLED
944#ifdef LIBXML_HTML_ENABLED
950#ifdef LIBXML_LEGACY_ENABLED
956#ifdef LIBXML_C14N_ENABLED
962#ifdef LIBXML_CATALOG_ENABLED
968#ifdef LIBXML_XPATH_ENABLED
974#ifdef LIBXML_XPTR_ENABLED
980#ifdef LIBXML_XINCLUDE_ENABLED
986#ifdef LIBXML_ICONV_ENABLED
992#ifdef LIBXML_ISO8859X_ENABLED
998#ifdef LIBXML_UNICODE_ENABLED
1004#ifdef LIBXML_REGEXP_ENABLED
1010#ifdef LIBXML_AUTOMATA_ENABLED
1016#ifdef LIBXML_EXPR_ENABLED
1022#ifdef LIBXML_SCHEMAS_ENABLED
1028#ifdef LIBXML_SCHEMATRON_ENABLED
1034#ifdef LIBXML_MODULES_ENABLED
1040#ifdef LIBXML_DEBUG_ENABLED
1046#ifdef DEBUG_MEMORY_LOCATION
1052#ifdef LIBXML_DEBUG_RUNTIME
1058#ifdef LIBXML_ZLIB_ENABLED
1064#ifdef LIBXML_LZMA_ENABLED
1070#ifdef LIBXML_ICU_ENABLED
1100 if (ctxt ==
NULL)
return;
1102#ifdef LIBXML_SAX1_ENABLED
1104 ((
sax->startElementNs !=
NULL) ||
1105 (
sax->endElementNs !=
NULL) ||
1126#if __STDC_VERSION__ >= 199901L
1157 while (*
src == 0x20)
src++;
1160 while (*
src == 0x20)
src++;
1188 int remove_head = 0;
1189 int need_realloc = 0;
1199 while (*
cur == 0x20) {
1206 if ((*
cur == 0x20) || (*
cur == 0)) {
1224 }
else if (remove_head) {
1225 *
len -= remove_head;
1284 (4 * 5) *
sizeof(
const xmlChar *));
1480 if (((
cur[0] ==
'i') && (
cur[1] ==
'-')) ||
1481 ((
cur[0] ==
'I') && (
cur[1] ==
'-')) ||
1482 ((
cur[0] ==
'x') && (
cur[1] ==
'-')) ||
1483 ((
cur[0] ==
'X') && (
cur[1] ==
'-'))) {
1490 while (((
cur[0] >=
'A') && (
cur[0] <=
'Z')) ||
1491 ((
cur[0] >=
'a') && (
cur[0] <=
'z')))
1493 return(
cur[0] == 0);
1496 while (((nxt[0] >=
'A') && (nxt[0] <=
'Z')) ||
1497 ((nxt[0] >=
'a') && (nxt[0] <=
'z')))
1499 if (nxt -
cur >= 4) {
1503 if ((nxt -
cur > 8) || (nxt[0] != 0))
1518 if ((nxt[0] >=
'0') && (nxt[0] <=
'9'))
1521 while (((nxt[0] >=
'A') && (nxt[0] <=
'Z')) ||
1522 ((nxt[0] >=
'a') && (nxt[0] <=
'z')))
1528 if ((nxt -
cur >= 5) && (nxt -
cur <= 8))
1541 if ((nxt[0] >=
'0') && (nxt[0] <=
'9'))
1544 while (((nxt[0] >=
'A') && (nxt[0] <=
'Z')) ||
1545 ((nxt[0] >=
'a') && (nxt[0] <=
'z')))
1549 if ((nxt -
cur >= 5) && (nxt -
cur <= 8))
1563 if ((nxt[0] >=
'0') && (nxt[0] <=
'9'))
1566 while (((nxt[0] >=
'A') && (nxt[0] <=
'Z')) ||
1567 ((nxt[0] >=
'a') && (nxt[0] <=
'z')))
1570 if ((nxt -
cur >= 5) && (nxt -
cur <= 8))
1584 while (((nxt[0] >=
'A') && (nxt[0] <=
'Z')) ||
1585 ((nxt[0] >=
'a') && (nxt[0] <=
'z')))
1588 if ((nxt -
cur < 5) || (nxt -
cur > 8))
1601 if (((nxt[1] >=
'0') && (nxt[1] <=
'9')) &&
1602 ((nxt[2] >=
'0') && (nxt[2] <=
'9'))) {
1635 for (
i = ctxt->
nsNr - 2;
i >= 0;
i -= 2) {
1636 if (ctxt->
nsTab[
i] == prefix) {
1638 if (ctxt->
nsTab[
i + 1] == URL)
1669 return (ctxt->
nsNr);
1690 if (ctxt->
nsNr <= 0)
1693 for (
i = 0;
i <
nr;
i++) {
1713 attallocs = (
int *)
xmlMalloc((maxatts / 5) *
sizeof(
int));
1714 if (attallocs ==
NULL)
goto mem_error;
1718 maxatts = (
nr + 5) * 2;
1720 maxatts *
sizeof(
const xmlChar *));
1724 (maxatts / 5) *
sizeof(
int));
1725 if (attallocs ==
NULL)
goto mem_error;
1803 if (ctxt ==
NULL)
return(0);
1820 "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
1904 tag->prefix = prefix;
1913#ifdef LIBXML_PUSH_ENABLED
1952 if (ctxt ==
NULL)
return (-1);
2018 if (ctxt->
spaceNr <= 0)
return(0);
2064#define RAW (*ctxt->input->cur)
2065#define CUR (*ctxt->input->cur)
2066#define NXT(val) ctxt->input->cur[(val)]
2067#define CUR_PTR ctxt->input->cur
2068#define BASE_PTR ctxt->input->base
2070#define CMP4( s, c1, c2, c3, c4 ) \
2071 ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
2072 ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
2073#define CMP5( s, c1, c2, c3, c4, c5 ) \
2074 ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
2075#define CMP6( s, c1, c2, c3, c4, c5, c6 ) \
2076 ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
2077#define CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) \
2078 ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
2079#define CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) \
2080 ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
2081#define CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) \
2082 ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
2083 ((unsigned char *) s)[ 8 ] == c9 )
2084#define CMP10( s, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10 ) \
2085 ( CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) && \
2086 ((unsigned char *) s)[ 9 ] == c10 )
2088#define SKIP(val) do { \
2089 ctxt->input->cur += (val),ctxt->input->col+=(val); \
2090 if (*ctxt->input->cur == 0) \
2091 xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \
2094#define SKIPL(val) do { \
2096 for(skipl=0; skipl<val; skipl++) { \
2097 if (*(ctxt->input->cur) == '\n') { \
2098 ctxt->input->line++; ctxt->input->col = 1; \
2099 } else ctxt->input->col++; \
2100 ctxt->input->cur++; \
2102 if (*ctxt->input->cur == 0) \
2103 xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \
2106#define SHRINK if ((ctxt->progressive == 0) && \
2107 (ctxt->input->cur - ctxt->input->base > 2 * INPUT_CHUNK) && \
2108 (ctxt->input->end - ctxt->input->cur < 2 * INPUT_CHUNK)) \
2117#define GROW if ((ctxt->progressive == 0) && \
2118 (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
2145#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
2147#define NEXT xmlNextChar(ctxt)
2150 ctxt->input->col++; \
2151 ctxt->input->cur++; \
2152 if (*ctxt->input->cur == 0) \
2153 xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \
2156#define NEXTL(l) do { \
2157 if (*(ctxt->input->cur) == '\n') { \
2158 ctxt->input->line++; ctxt->input->col = 1; \
2159 } else ctxt->input->col++; \
2160 ctxt->input->cur += l; \
2163#define CUR_CHAR(l) xmlCurrentChar(ctxt, &l)
2164#define CUR_SCHAR(s, l) xmlStringCurrentChar(ctxt, s, &l)
2166#define COPY_BUF(l,b,i,v) \
2167 if (l == 1) b[i++] = (xmlChar) v; \
2168 else i += xmlCopyCharMultiByte(&b[i],v)
2170#define CUR_CONSUMED \
2171 (ctxt->input->consumed + (ctxt->input->cur - ctxt->input->base))
2220 }
else if (
CUR ==
'%') {
2227 }
else if (
CUR == 0) {
2266 if ((ctxt ==
NULL) || (ctxt->
inputNr <= 1))
return(0);
2269 "Popping input %d\n", ctxt->
inputNr);
2273 "Unfinished entity outside the DTD");
2300 "Pushing input %d : %.30s\n", ctxt->
inputNr+1,
input->cur);
2339 if ((
RAW ==
'&') && (
NXT(1) ==
'#') &&
2343 while (
RAW !=
';') {
2350 if ((
RAW >=
'0') && (
RAW <=
'9'))
2352 else if ((
RAW >=
'a') && (
RAW <=
'f') && (
count < 20))
2354 else if ((
RAW >=
'A') && (
RAW <=
'F') && (
count < 20))
2372 }
else if ((
RAW ==
'&') && (
NXT(1) ==
'#')) {
2375 while (
RAW !=
';') {
2382 if ((
RAW >=
'0') && (
RAW <=
'9'))
2409 if (
val >= 0x110000) {
2411 "xmlParseCharRef: character reference out of bounds\n",
2417 "xmlParseCharRef: invalid xmlChar value %d\n",
2450 if ((
cur ==
'&') && (
ptr[1] ==
'#') && (
ptr[2] ==
'x')) {
2453 while (
cur !=
';') {
2454 if ((
cur >=
'0') && (
cur <=
'9'))
2456 else if ((
cur >=
'a') && (
cur <=
'f'))
2458 else if ((
cur >=
'A') && (
cur <=
'F'))
2473 }
else if ((
cur ==
'&') && (
ptr[1] ==
'#')){
2476 while (
cur !=
';') {
2477 if ((
cur >=
'0') && (
cur <=
'9'))
2503 if (
val >= 0x110000) {
2505 "xmlParseStringCharRef: character reference out of bounds\n",
2511 "xmlParseStringCharRef: invalid xmlChar value %d\n",
2613#define growBuffer(buffer, n) { \
2615 size_t new_size = buffer##_size * 2 + n; \
2616 if (new_size < buffer##_size) goto mem_error; \
2617 tmp = (xmlChar *) xmlRealloc(buffer, new_size); \
2618 if (tmp == NULL) goto mem_error; \
2620 buffer##_size = new_size; \
2659 if (((ctxt->
depth > 40) &&
2661 (ctxt->
depth > 1024)) {
2681 while ((
c != 0) && (
c !=
end) &&
2682 (
c != end2) && (
c != end3) &&
2686 if ((
c ==
'&') && (
str[1] ==
'#')) {
2697 "String decoding Entity Reference: %.30s\n",
2703 if ((ent !=
NULL) &&
2712 "predefined entity has no content\n");
2736 }
else if (ent !=
NULL) {
2751 "String decoding PE Reference: %.30s\n",
str);
2770 "not validating will not read content for PE entity %s\n",
2873 if (ctxt->
sax->ignorableWhitespace == ctxt->
sax->characters)
2880 (*(ctxt->
space) == -2))
2886 if (blank_chars == 0) {
2897 if (
ret == 0)
return(1);
2898 if (
ret == 1)
return(0);
2904 if ((
RAW !=
'<') && (
RAW != 0xD))
return(0);
2906 (
RAW ==
'<') && (
NXT(1) ==
'/'))
return(0);
2909 if (lastChild ==
NULL) {
2960#ifndef XML_XML_NAMESPACE
2962 if ((
cur[0] ==
'x') && (
cur[1] ==
'm') &&
2963 (
cur[2] ==
'l') && (
cur[3] ==
':'))
2972 while ((
c != 0) && (
c !=
':') && (
len <
max)) {
2989 while ((
c != 0) && (
c !=
':')) {
3009 if ((
c ==
':') && (*
cur == 0)) {
3037 if (!(((
c >= 0x61) && (
c <= 0x7A)) ||
3038 ((
c >= 0x41) && (
c <= 0x5A)) ||
3039 (
c ==
'_') || (
c ==
':'))) {
3045 "Name %s is not XML Namespace compliant\n",
3051 while ((
c != 0) && (
len <
max)) {
3111static unsigned long nbParseName = 0;
3112static unsigned long nbParseNmToken = 0;
3113static unsigned long nbParseNCName = 0;
3114static unsigned long nbParseNCNameComplex = 0;
3115static unsigned long nbParseNameComplex = 0;
3116static unsigned long nbParseStringName = 0;
3136 if ((
c !=
' ') && (
c !=
'>') && (
c !=
'/') &&
3137 (((
c >=
'a') && (
c <=
'z')) ||
3138 ((
c >=
'A') && (
c <=
'Z')) ||
3139 (
c ==
'_') || (
c ==
':') ||
3140 ((
c >= 0xC0) && (
c <= 0xD6)) ||
3141 ((
c >= 0xD8) && (
c <= 0xF6)) ||
3142 ((
c >= 0xF8) && (
c <= 0x2FF)) ||
3143 ((
c >= 0x370) && (
c <= 0x37D)) ||
3144 ((
c >= 0x37F) && (
c <= 0x1FFF)) ||
3145 ((
c >= 0x200C) && (
c <= 0x200D)) ||
3146 ((
c >= 0x2070) && (
c <= 0x218F)) ||
3147 ((
c >= 0x2C00) && (
c <= 0x2FEF)) ||
3148 ((
c >= 0x3001) && (
c <= 0xD7FF)) ||
3149 ((
c >= 0xF900) && (
c <= 0xFDCF)) ||
3150 ((
c >= 0xFDF0) && (
c <= 0xFFFD)) ||
3151 ((
c >= 0x10000) && (
c <= 0xEFFFF))))
3167 if ((
c !=
' ') && (
c !=
'>') && (
c !=
'/') &&
3168 (((
c >=
'a') && (
c <=
'z')) ||
3169 ((
c >=
'A') && (
c <=
'Z')) ||
3170 ((
c >=
'0') && (
c <=
'9')) ||
3171 (
c ==
'_') || (
c ==
':') ||
3172 (
c ==
'-') || (
c ==
'.') || (
c == 0xB7) ||
3173 ((
c >= 0xC0) && (
c <= 0xD6)) ||
3174 ((
c >= 0xD8) && (
c <= 0xF6)) ||
3175 ((
c >= 0xF8) && (
c <= 0x2FF)) ||
3176 ((
c >= 0x300) && (
c <= 0x36F)) ||
3177 ((
c >= 0x370) && (
c <= 0x37D)) ||
3178 ((
c >= 0x37F) && (
c <= 0x1FFF)) ||
3179 ((
c >= 0x200C) && (
c <= 0x200D)) ||
3180 ((
c >= 0x203F) && (
c <= 0x2040)) ||
3181 ((
c >= 0x2070) && (
c <= 0x218F)) ||
3182 ((
c >= 0x2C00) && (
c <= 0x2FEF)) ||
3183 ((
c >= 0x3001) && (
c <= 0xD7FF)) ||
3184 ((
c >= 0xF900) && (
c <= 0xFDCF)) ||
3185 ((
c >= 0xFDF0) && (
c <= 0xFFFD)) ||
3186 ((
c >= 0x10000) && (
c <= 0xEFFFF))))
3190 (
c ==
'.') || (
c ==
'-') ||
3191 (
c ==
'_') || (
c ==
':') ||
3212 nbParseNameComplex++;
3227 if ((
c ==
' ') || (
c ==
'>') || (
c ==
'/') ||
3228 (!(((
c >=
'a') && (
c <=
'z')) ||
3229 ((
c >=
'A') && (
c <=
'Z')) ||
3230 (
c ==
'_') || (
c ==
':') ||
3231 ((
c >= 0xC0) && (
c <= 0xD6)) ||
3232 ((
c >= 0xD8) && (
c <= 0xF6)) ||
3233 ((
c >= 0xF8) && (
c <= 0x2FF)) ||
3234 ((
c >= 0x370) && (
c <= 0x37D)) ||
3235 ((
c >= 0x37F) && (
c <= 0x1FFF)) ||
3236 ((
c >= 0x200C) && (
c <= 0x200D)) ||
3237 ((
c >= 0x2070) && (
c <= 0x218F)) ||
3238 ((
c >= 0x2C00) && (
c <= 0x2FEF)) ||
3239 ((
c >= 0x3001) && (
c <= 0xD7FF)) ||
3240 ((
c >= 0xF900) && (
c <= 0xFDCF)) ||
3241 ((
c >= 0xFDF0) && (
c <= 0xFFFD)) ||
3242 ((
c >= 0x10000) && (
c <= 0xEFFFF))))) {
3248 while ((
c !=
' ') && (
c !=
'>') && (
c !=
'/') &&
3249 (((
c >=
'a') && (
c <=
'z')) ||
3250 ((
c >=
'A') && (
c <=
'Z')) ||
3251 ((
c >=
'0') && (
c <=
'9')) ||
3252 (
c ==
'_') || (
c ==
':') ||
3253 (
c ==
'-') || (
c ==
'.') || (
c == 0xB7) ||
3254 ((
c >= 0xC0) && (
c <= 0xD6)) ||
3255 ((
c >= 0xD8) && (
c <= 0xF6)) ||
3256 ((
c >= 0xF8) && (
c <= 0x2FF)) ||
3257 ((
c >= 0x300) && (
c <= 0x36F)) ||
3258 ((
c >= 0x370) && (
c <= 0x37D)) ||
3259 ((
c >= 0x37F) && (
c <= 0x1FFF)) ||
3260 ((
c >= 0x200C) && (
c <= 0x200D)) ||
3261 ((
c >= 0x203F) && (
c <= 0x2040)) ||
3262 ((
c >= 0x2070) && (
c <= 0x218F)) ||
3263 ((
c >= 0x2C00) && (
c <= 0x2FEF)) ||
3264 ((
c >= 0x3001) && (
c <= 0xD7FF)) ||
3265 ((
c >= 0xF900) && (
c <= 0xFDCF)) ||
3266 ((
c >= 0xFDF0) && (
c <= 0xFFFD)) ||
3267 ((
c >= 0x10000) && (
c <= 0xEFFFF))
3281 if ((
c ==
' ') || (
c ==
'>') || (
c ==
'/') ||
3290 while ((
c !=
' ') && (
c !=
'>') && (
c !=
'/') &&
3292 (
c ==
'.') || (
c ==
'-') ||
3293 (
c ==
'_') || (
c ==
':') ||
3319 "unexpected change of input buffer");
3362 if (((*
in >= 0x61) && (*
in <= 0x7A)) ||
3363 ((*
in >= 0x41) && (*
in <= 0x5A)) ||
3364 (*
in ==
'_') || (*
in ==
':')) {
3366 while (((*
in >= 0x61) && (*
in <= 0x7A)) ||
3367 ((*
in >= 0x41) && (*
in <= 0x5A)) ||
3368 ((*
in >= 0x30) && (*
in <= 0x39)) ||
3369 (*
in ==
'_') || (*
in ==
'-') ||
3370 (*
in ==
':') || (*
in ==
'.'))
3372 if ((*
in > 0) && (*
in < 0x80)) {
3398 size_t startPosition = 0;
3401 nbParseNCNameComplex++;
3410 if ((
c ==
' ') || (
c ==
'>') || (
c ==
'/') ||
3415 while ((
c !=
' ') && (
c !=
'>') && (
c !=
'/') &&
3482 if ((((*
in >= 0x61) && (*
in <= 0x7A)) ||
3483 ((*
in >= 0x41) && (*
in <= 0x5A)) ||
3484 (*
in ==
'_')) && (
in <
e)) {
3486 while ((((*
in >= 0x61) && (*
in <= 0x7A)) ||
3487 ((*
in >= 0x41) && (*
in <= 0x5A)) ||
3488 ((*
in >= 0x30) && (*
in <= 0x39)) ||
3489 (*
in ==
'_') || (*
in ==
'-') ||
3490 (*
in ==
'.')) && (
in <
e))
3494 if ((*
in > 0) && (*
in < 0x80)) {
3535 while (*
in != 0 && *
in == *
cmp) {
3583 nbParseStringName++;
3780 if (
RAW ==
'"') stop =
'"';
3781 else if (
RAW ==
'\'') stop =
'\'';
3837 "entity value too long\n");
3857 if ((*
cur ==
'%') || ((*
cur ==
'&') && (
cur[1] !=
'#'))) {
3868 if ((nameOk == 0) || (*
cur !=
';')) {
3870 "EntityValue: '%c' forbidden except for entities references\n",
3874 if ((tmp ==
'%') && (ctxt->
inSubset == 1) &&
3926 size_t buf_size = 0;
3930 int c,
l, in_space = 0;
3934 if (
NXT(0) ==
'"') {
3938 }
else if (
NXT(0) ==
'\'') {
3952 if (
buf ==
NULL)
goto mem_error;
3963 if (
NXT(1) ==
'#') {
3968 if (
len + 10 > buf_size) {
3977 if (
len + 10 > buf_size) {
3986 }
else if (
val != 0) {
3987 if (
len + 10 > buf_size) {
3997 if ((ent !=
NULL) &&
3999 if (
len + 10 > buf_size) {
4012 }
else if ((ent !=
NULL) &&
4029 if (
len + 10 > buf_size) {
4037 if (
len + 10 > buf_size) {
4043 }
else if (ent !=
NULL) {
4053 unsigned long oldnbent = ctxt->
nbentities, diff;
4078 while (
len +
i + 10 > buf_size) {
4087 if ((
c == 0x20) || (
c == 0xD) || (
c == 0xA) || (
c == 0x9)) {
4091 while (
len + 10 > buf_size) {
4100 if (
len + 10 > buf_size) {
4110 "AttValue length too long\n");
4126 "invalid character in attribute value\n");
4129 "AttValue: ' expected\n");
4215 }
else if (
RAW ==
'\'') {
4307 }
else if (
RAW ==
'\'') {
4374 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4375 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4376 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4377 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4378 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x00, 0x27,
4379 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
4380 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
4381 0x38, 0x39, 0x3A, 0x3B, 0x00, 0x3D, 0x3E, 0x3F,
4382 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
4383 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
4384 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
4385 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x00, 0x5E, 0x5F,
4386 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
4387 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
4388 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
4389 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
4390 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4391 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4392 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4393 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4394 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4395 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4396 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4397 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4398 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4399 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4400 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4401 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4402 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4403 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4404 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4405 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
4447 }
while (*
in == 0xA);
4448 goto get_more_space;
4457 (ctxt->
sax->ignorableWhitespace !=
4458 ctxt->
sax->characters)) {
4460 if (ctxt->
sax->ignorableWhitespace !=
NULL)
4464 if (ctxt->
sax->characters !=
NULL)
4467 if (*ctxt->
space == -1)
4470 }
else if ((ctxt->
sax !=
NULL) &&
4471 (ctxt->
sax->characters !=
NULL)) {
4490 }
while (*
in == 0xA);
4494 if ((
in[1] ==
']') && (
in[2] ==
'>')) {
4506 (ctxt->
sax->ignorableWhitespace !=
4507 ctxt->
sax->characters) &&
4513 if (ctxt->
sax->ignorableWhitespace !=
NULL)
4517 if (ctxt->
sax->characters !=
NULL)
4520 if (*ctxt->
space == -1)
4525 }
else if (ctxt->
sax !=
NULL) {
4526 if (ctxt->
sax->characters !=
NULL)
4558 }
while (((*
in >= 0x20) && (*
in <= 0x7F)) || (*
in == 0x09) || (*
in == 0x0a));
4585 while ((
cur !=
'<') &&
4588 if ((
cur ==
']') && (
NXT(1) ==
']') &&
4607 if (ctxt->
sax->ignorableWhitespace !=
NULL)
4611 if (ctxt->
sax->characters !=
NULL)
4613 if ((ctxt->
sax->characters !=
4614 ctxt->
sax->ignorableWhitespace) &&
4615 (*ctxt->
space == -1))
4640 if (ctxt->
sax->ignorableWhitespace !=
NULL)
4643 if (ctxt->
sax->characters !=
NULL)
4645 if ((ctxt->
sax->characters != ctxt->
sax->ignorableWhitespace) &&
4646 (*ctxt->
space == -1))
4654 "PCDATA invalid Char value %d\n",
4689 if (
CMP6(
CUR_PTR,
'S',
'Y',
'S',
'T',
'E',
'M')) {
4693 "Space required after 'SYSTEM'\n");
4699 }
else if (
CMP6(
CUR_PTR,
'P',
'U',
'B',
'L',
'I',
'C')) {