35 #pragma convert("ISO8859-1") 41 #if defined(_WIN32) && !defined (__CYGWIN__) 42 #define XML_DIR_SEP '\\' 44 #define XML_DIR_SEP '/' 64 #ifdef LIBXML_CATALOG_ENABLED 67 #ifdef LIBXML_SCHEMAS_ENABLED 77 #ifdef HAVE_SYS_STAT_H 111 #define XML_PARSER_BIG_ENTITY 1000 112 #define XML_PARSER_LOT_ENTITY 5000 120 #define XML_PARSER_NON_LINEAR 10 149 unsigned long oldnbent = ctxt->
nbentities, diff;
173 if (replacement != 0) {
190 }
else if (
size != 0) {
209 }
else if (ent !=
NULL) {
256 #define XML_PARSER_BIG_BUFFER_SIZE 300 257 #define XML_PARSER_BUFFER_SIZE 100 258 #define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document" 269 #define XML_PARSER_CHUNK_SIZE 100 295 #ifdef LIBXML_LEGACY_ENABLED 335 (
const char *) localname,
NULL,
NULL, 0, 0,
336 "Attribute %s redefined\n", localname);
340 (
const char *) prefix, (
const char *) localname,
341 NULL, 0, 0,
"Attribute %s:%s redefined\n", prefix,
368 errmsg =
"CharRef: invalid hexadecimal value";
371 errmsg =
"CharRef: invalid decimal value";
374 errmsg =
"CharRef: invalid value";
377 errmsg =
"internal error";
380 errmsg =
"PEReference at end of document";
383 errmsg =
"PEReference in prolog";
386 errmsg =
"PEReference in epilog";
389 errmsg =
"PEReference: no name";
392 errmsg =
"PEReference: expecting ';'";
395 errmsg =
"Detected an entity reference loop";
398 errmsg =
"EntityValue: \" or ' expected";
401 errmsg =
"PEReferences forbidden in internal subset";
404 errmsg =
"EntityValue: \" or ' expected";
407 errmsg =
"AttValue: \" or ' expected";
410 errmsg =
"Unescaped '<' not allowed in attributes values";
413 errmsg =
"SystemLiteral \" or ' expected";
416 errmsg =
"Unfinished System or Public ID \" or ' expected";
419 errmsg =
"Sequence ']]>' not allowed in content";
422 errmsg =
"SYSTEM or PUBLIC, the URI is missing";
425 errmsg =
"PUBLIC, the Public Identifier is missing";
428 errmsg =
"Comment must not contain '--' (double-hyphen)";
431 errmsg =
"xmlParsePI : no target name";
434 errmsg =
"Invalid PI name";
437 errmsg =
"NOTATION: Name expected here";
440 errmsg =
"'>' required to close NOTATION declaration";
443 errmsg =
"Entity value required";
446 errmsg =
"Fragment not allowed";
449 errmsg =
"'(' required to start ATTLIST enumeration";
452 errmsg =
"NmToken expected in ATTLIST enumeration";
455 errmsg =
"')' required to finish ATTLIST enumeration";
458 errmsg =
"MixedContentDecl : '|' or ')*' expected";
461 errmsg =
"MixedContentDecl : '#PCDATA' expected";
464 errmsg =
"ContentDecl : Name or '(' expected";
467 errmsg =
"ContentDecl : ',' '|' or ')' expected";
471 "PEReference: forbidden within markup decl in internal subset";
477 errmsg =
"XML conditional section '[' expected";
480 errmsg =
"Content error in the external subset";
484 "conditional section INCLUDE or IGNORE keyword expected";
487 errmsg =
"XML conditional section not closed";
490 errmsg =
"Text declaration '<?xml' required";
493 errmsg =
"parsing XML declaration: '?>' expected";
496 errmsg =
"external parsed entities cannot be standalone";
499 errmsg =
"EntityRef: expecting ';'";
502 errmsg =
"DOCTYPE improperly terminated";
505 errmsg =
"EndTag: '</' not found";
511 errmsg =
"String not closed expecting \" or '";
514 errmsg =
"String not started expecting ' or \"";
517 errmsg =
"Invalid XML encoding name";
520 errmsg =
"standalone accepts only 'yes' or 'no'";
523 errmsg =
"Document is empty";
526 errmsg =
"Extra content at the end of the document";
529 errmsg =
"chunk is not well balanced";
532 errmsg =
"extra content at the end of well balanced chunk";
535 errmsg =
"Malformed declaration expecting version";
538 errmsg =
"Name too long use XML_PARSE_HUGE option";
546 errmsg =
"Unregistered error message";
578 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
586 ctxt->wellFormed = 0;
587 if (ctxt->recovery == 0)
588 ctxt->disableSAX = 1;
606 xmlStructuredErrorFunc schannel =
NULL;
608 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
611 if ((ctxt !=
NULL) && (ctxt->sax !=
NULL) &&
613 schannel = ctxt->sax->serror;
615 __xmlRaiseError(schannel,
616 (ctxt->sax) ? ctxt->sax->warning :
NULL,
620 (
const char *) str1, (
const char *) str2,
NULL, 0, 0,
621 msg, (
const char *) str1, (
const char *) str2);
623 __xmlRaiseError(schannel,
NULL,
NULL,
626 (
const char *) str1, (
const char *) str2,
NULL, 0, 0,
627 msg, (
const char *) str1, (
const char *) str2);
644 xmlStructuredErrorFunc schannel =
NULL;
646 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
652 schannel = ctxt->sax->serror;
655 __xmlRaiseError(schannel,
656 ctxt->vctxt.error, ctxt->vctxt.userData,
659 (
const char *) str2,
NULL, 0, 0,
660 msg, (
const char *) str1, (
const char *) str2);
663 __xmlRaiseError(schannel,
NULL,
NULL,
666 (
const char *) str2,
NULL, 0, 0,
667 msg, (
const char *) str1, (
const char *) str2);
684 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
693 ctxt->wellFormed = 0;
694 if (ctxt->recovery == 0)
695 ctxt->disableSAX = 1;
715 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
722 NULL, 0, (
const char *) str1, (
const char *) str2,
725 ctxt->wellFormed = 0;
726 if (ctxt->recovery == 0)
727 ctxt->disableSAX = 1;
744 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
754 ctxt->wellFormed = 0;
755 if (ctxt->recovery == 0)
756 ctxt->disableSAX = 1;
773 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
800 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
807 (
const char *) info2, (
const char *) info3, 0, 0,
msg,
808 info1, info2, info3);
810 ctxt->nsWellFormed = 0;
829 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
834 (
const char *) info2, (
const char *) info3, 0, 0,
msg,
835 info1, info2, info3);
859 #ifdef LIBXML_THREAD_ENABLED 865 #ifdef LIBXML_TREE_ENABLED 871 #ifdef LIBXML_OUTPUT_ENABLED 877 #ifdef LIBXML_PUSH_ENABLED 883 #ifdef LIBXML_READER_ENABLED 889 #ifdef LIBXML_PATTERN_ENABLED 895 #ifdef LIBXML_WRITER_ENABLED 901 #ifdef LIBXML_SAX1_ENABLED 907 #ifdef LIBXML_FTP_ENABLED 913 #ifdef LIBXML_HTTP_ENABLED 919 #ifdef LIBXML_VALID_ENABLED 925 #ifdef LIBXML_HTML_ENABLED 931 #ifdef LIBXML_LEGACY_ENABLED 937 #ifdef LIBXML_C14N_ENABLED 943 #ifdef LIBXML_CATALOG_ENABLED 949 #ifdef LIBXML_XPATH_ENABLED 955 #ifdef LIBXML_XPTR_ENABLED 961 #ifdef LIBXML_XINCLUDE_ENABLED 967 #ifdef LIBXML_ICONV_ENABLED 973 #ifdef LIBXML_ISO8859X_ENABLED 979 #ifdef LIBXML_UNICODE_ENABLED 985 #ifdef LIBXML_REGEXP_ENABLED 991 #ifdef LIBXML_AUTOMATA_ENABLED 997 #ifdef LIBXML_EXPR_ENABLED 1003 #ifdef LIBXML_SCHEMAS_ENABLED 1009 #ifdef LIBXML_SCHEMATRON_ENABLED 1015 #ifdef LIBXML_MODULES_ENABLED 1021 #ifdef LIBXML_DEBUG_ENABLED 1027 #ifdef DEBUG_MEMORY_LOCATION 1033 #ifdef LIBXML_DEBUG_RUNTIME 1039 #ifdef LIBXML_ZLIB_ENABLED 1045 #ifdef LIBXML_LZMA_ENABLED 1051 #ifdef LIBXML_ICU_ENABLED 1076 if (ctxt ==
NULL)
return;
1077 #ifdef LIBXML_SAX1_ENABLED 1079 ((ctxt->
sax->startElementNs !=
NULL) ||
1080 (ctxt->
sax->endElementNs !=
NULL))) ctxt->
sax2 = 1;
1099 #if __STDC_VERSION__ >= 199901L 1130 while (*
src == 0x20)
src++;
1133 while (*
src == 0x20)
src++;
1161 int remove_head = 0;
1162 int need_realloc = 0;
1172 while (*
cur == 0x20) {
1179 if ((*
cur == 0x20) || (*
cur == 0)) {
1197 }
else if (remove_head) {
1198 *
len -= remove_head;
1257 (4 * 5) *
sizeof(
const xmlChar *));
1453 if (((
cur[0] ==
'i') && (
cur[1] ==
'-')) ||
1454 ((
cur[0] ==
'I') && (
cur[1] ==
'-')) ||
1455 ((
cur[0] ==
'x') && (
cur[1] ==
'-')) ||
1456 ((
cur[0] ==
'X') && (
cur[1] ==
'-'))) {
1463 while (((
cur[0] >=
'A') && (
cur[0] <=
'Z')) ||
1464 ((
cur[0] >=
'a') && (
cur[0] <=
'z')))
1466 return(
cur[0] == 0);
1469 while (((nxt[0] >=
'A') && (nxt[0] <=
'Z')) ||
1470 ((nxt[0] >=
'a') && (nxt[0] <=
'z')))
1472 if (nxt -
cur >= 4) {
1476 if ((nxt -
cur > 8) || (nxt[0] != 0))
1491 if ((nxt[0] >=
'0') && (nxt[0] <=
'9'))
1494 while (((nxt[0] >=
'A') && (nxt[0] <=
'Z')) ||
1495 ((nxt[0] >=
'a') && (nxt[0] <=
'z')))
1501 if ((nxt -
cur >= 5) && (nxt -
cur <= 8))
1514 if ((nxt[0] >=
'0') && (nxt[0] <=
'9'))
1517 while (((nxt[0] >=
'A') && (nxt[0] <=
'Z')) ||
1518 ((nxt[0] >=
'a') && (nxt[0] <=
'z')))
1522 if ((nxt -
cur >= 5) && (nxt -
cur <= 8))
1536 if ((nxt[0] >=
'0') && (nxt[0] <=
'9'))
1539 while (((nxt[0] >=
'A') && (nxt[0] <=
'Z')) ||
1540 ((nxt[0] >=
'a') && (nxt[0] <=
'z')))
1543 if ((nxt -
cur >= 5) && (nxt -
cur <= 8))
1557 while (((nxt[0] >=
'A') && (nxt[0] <=
'Z')) ||
1558 ((nxt[0] >=
'a') && (nxt[0] <=
'z')))
1561 if ((nxt -
cur < 5) || (nxt -
cur > 8))
1574 if (((nxt[1] >=
'0') && (nxt[1] <=
'9')) &&
1575 ((nxt[2] >=
'0') && (nxt[2] <=
'9'))) {
1608 for (
i = ctxt->
nsNr - 2;
i >= 0;
i -= 2) {
1609 if (ctxt->
nsTab[
i] == prefix) {
1611 if (ctxt->
nsTab[
i + 1] == URL)
1642 return (ctxt->
nsNr);
1663 if (ctxt->
nsNr <= 0)
1666 for (
i = 0;
i <
nr;
i++) {
1686 attallocs = (
int *)
xmlMalloc((maxatts / 5) *
sizeof(
int));
1687 if (attallocs ==
NULL)
goto mem_error;
1691 maxatts = (
nr + 5) * 2;
1693 maxatts *
sizeof(
const xmlChar *));
1697 (maxatts / 5) *
sizeof(
int));
1698 if (attallocs ==
NULL)
goto mem_error;
1778 if (ctxt ==
NULL)
return(0);
1795 "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
1882 #ifdef LIBXML_PUSH_ENABLED 1921 if (ctxt ==
NULL)
return (-1);
1987 if (ctxt->
spaceNr <= 0)
return(0);
2033 #define RAW (*ctxt->input->cur) 2034 #define CUR (*ctxt->input->cur) 2035 #define NXT(val) ctxt->input->cur[(val)] 2036 #define CUR_PTR ctxt->input->cur 2037 #define BASE_PTR ctxt->input->base 2039 #define CMP4( s, c1, c2, c3, c4 ) \ 2040 ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \ 2041 ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 ) 2042 #define CMP5( s, c1, c2, c3, c4, c5 ) \ 2043 ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 ) 2044 #define CMP6( s, c1, c2, c3, c4, c5, c6 ) \ 2045 ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 ) 2046 #define CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) \ 2047 ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 ) 2048 #define CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) \ 2049 ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 ) 2050 #define CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) \ 2051 ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \ 2052 ((unsigned char *) s)[ 8 ] == c9 ) 2053 #define CMP10( s, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10 ) \ 2054 ( CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) && \ 2055 ((unsigned char *) s)[ 9 ] == c10 ) 2057 #define SKIP(val) do { \ 2058 ctxt->nbChars += (val),ctxt->input->cur += (val),ctxt->input->col+=(val); \ 2059 if (*ctxt->input->cur == 0) \ 2060 xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \ 2063 #define SKIPL(val) do { \ 2065 for(skipl=0; skipl<val; skipl++) { \ 2066 if (*(ctxt->input->cur) == '\n') { \ 2067 ctxt->input->line++; ctxt->input->col = 1; \ 2068 } else ctxt->input->col++; \ 2070 ctxt->input->cur++; \ 2072 if (*ctxt->input->cur == 0) \ 2073 xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \ 2076 #define SHRINK if ((ctxt->progressive == 0) && \ 2077 (ctxt->input->cur - ctxt->input->base > 2 * INPUT_CHUNK) && \ 2078 (ctxt->input->end - ctxt->input->cur < 2 * INPUT_CHUNK)) \ 2087 #define GROW if ((ctxt->progressive == 0) && \ 2088 (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \ 2115 #define SKIP_BLANKS xmlSkipBlankChars(ctxt) 2117 #define NEXT xmlNextChar(ctxt) 2120 ctxt->input->col++; \ 2121 ctxt->input->cur++; \ 2123 if (*ctxt->input->cur == 0) \ 2124 xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \ 2127 #define NEXTL(l) do { \ 2128 if (*(ctxt->input->cur) == '\n') { \ 2129 ctxt->input->line++; ctxt->input->col = 1; \ 2130 } else ctxt->input->col++; \ 2131 ctxt->input->cur += l; \ 2134 #define CUR_CHAR(l) xmlCurrentChar(ctxt, &l) 2135 #define CUR_SCHAR(s, l) xmlStringCurrentChar(ctxt, s, &l) 2137 #define COPY_BUF(l,b,i,v) \ 2138 if (l == 1) b[i++] = (xmlChar) v; \ 2139 else i += xmlCopyCharMultiByte(&b[i],v) 2186 }
else if (
CUR ==
'%') {
2193 }
else if (
CUR == 0) {
2231 if ((ctxt ==
NULL) || (ctxt->
inputNr <= 1))
return(0);
2234 "Popping input %d\n", ctxt->
inputNr);
2238 "Unfinished entity outside the DTD");
2265 "Pushing input %d : %.30s\n", ctxt->
inputNr+1,
input->cur);
2304 if ((
RAW ==
'&') && (
NXT(1) ==
'#') &&
2308 while (
RAW !=
';') {
2315 if ((
RAW >=
'0') && (
RAW <=
'9'))
2317 else if ((
RAW >=
'a') && (
RAW <=
'f') && (
count < 20))
2319 else if ((
RAW >=
'A') && (
RAW <=
'F') && (
count < 20))
2338 }
else if ((
RAW ==
'&') && (
NXT(1) ==
'#')) {
2341 while (
RAW !=
';') {
2348 if ((
RAW >=
'0') && (
RAW <=
'9'))
2376 if (
val >= 0x110000) {
2378 "xmlParseCharRef: character reference out of bounds\n",
2384 "xmlParseCharRef: invalid xmlChar value %d\n",
2417 if ((
cur ==
'&') && (
ptr[1] ==
'#') && (
ptr[2] ==
'x')) {
2420 while (
cur !=
';') {
2421 if ((
cur >=
'0') && (
cur <=
'9'))
2423 else if ((
cur >=
'a') && (
cur <=
'f'))
2425 else if ((
cur >=
'A') && (
cur <=
'F'))
2440 }
else if ((
cur ==
'&') && (
ptr[1] ==
'#')){
2443 while (
cur !=
';') {
2444 if ((
cur >=
'0') && (
cur <=
'9'))
2470 if (
val >= 0x110000) {
2472 "xmlParseStringCharRef: character reference out of bounds\n",
2478 "xmlParseStringCharRef: invalid xmlChar value %d\n",
2580 #define growBuffer(buffer, n) { \ 2582 size_t new_size = buffer##_size * 2 + n; \ 2583 if (new_size < buffer##_size) goto mem_error; \ 2584 tmp = (xmlChar *) xmlRealloc(buffer, new_size); \ 2585 if (tmp == NULL) goto mem_error; \ 2587 buffer##_size = new_size; \ 2626 if (((ctxt->
depth > 40) &&
2628 (ctxt->
depth > 1024)) {
2648 while ((
c != 0) && (
c !=
end) &&
2649 (
c != end2) && (
c != end3)) {
2652 if ((
c ==
'&') && (
str[1] ==
'#')) {
2663 "String decoding Entity Reference: %.30s\n",
2669 if ((ent !=
NULL) &&
2678 "predefined entity has no content\n");
2700 }
else if (ent !=
NULL) {
2715 "String decoding PE Reference: %.30s\n",
str);
2734 "not validating will not read content for PE entity %s\n",
2834 if (ctxt->
sax->ignorableWhitespace == ctxt->
sax->characters)
2841 (*(ctxt->
space) == -2))
2847 if (blank_chars == 0) {
2858 if (
ret == 0)
return(1);
2859 if (
ret == 1)
return(0);
2865 if ((
RAW !=
'<') && (
RAW != 0xD))
return(0);
2867 (
RAW ==
'<') && (
NXT(1) ==
'/'))
return(0);
2870 if (lastChild ==
NULL) {
2921 #ifndef XML_XML_NAMESPACE 2923 if ((
cur[0] ==
'x') && (
cur[1] ==
'm') &&
2924 (
cur[2] ==
'l') && (
cur[3] ==
':'))
2933 while ((
c != 0) && (
c !=
':') && (
len <
max)) {
2950 while ((
c != 0) && (
c !=
':')) {
2970 if ((
c ==
':') && (*
cur == 0)) {
2998 if (!(((
c >= 0x61) && (
c <= 0x7A)) ||
2999 ((
c >= 0x41) && (
c <= 0x5A)) ||
3000 (
c ==
'_') || (
c ==
':'))) {
3006 "Name %s is not XML Namespace compliant\n",
3012 while ((
c != 0) && (
len <
max)) {
3072 static unsigned long nbParseName = 0;
3073 static unsigned long nbParseNmToken = 0;
3074 static unsigned long nbParseNCName = 0;
3075 static unsigned long nbParseNCNameComplex = 0;
3076 static unsigned long nbParseNameComplex = 0;
3077 static unsigned long nbParseStringName = 0;
3097 if ((
c !=
' ') && (
c !=
'>') && (
c !=
'/') &&
3098 (((
c >=
'a') && (
c <=
'z')) ||
3099 ((
c >=
'A') && (
c <=
'Z')) ||
3100 (
c ==
'_') || (
c ==
':') ||
3101 ((
c >= 0xC0) && (
c <= 0xD6)) ||
3102 ((
c >= 0xD8) && (
c <= 0xF6)) ||
3103 ((
c >= 0xF8) && (
c <= 0x2FF)) ||
3104 ((
c >= 0x370) && (
c <= 0x37D)) ||
3105 ((
c >= 0x37F) && (
c <= 0x1FFF)) ||
3106 ((
c >= 0x200C) && (
c <= 0x200D)) ||
3107 ((
c >= 0x2070) && (
c <= 0x218F)) ||
3108 ((
c >= 0x2C00) && (
c <= 0x2FEF)) ||
3109 ((
c >= 0x3001) && (
c <= 0xD7FF)) ||
3110 ((
c >= 0xF900) && (
c <= 0xFDCF)) ||
3111 ((
c >= 0xFDF0) && (
c <= 0xFFFD)) ||
3112 ((
c >= 0x10000) && (
c <= 0xEFFFF))))
3128 if ((
c !=
' ') && (
c !=
'>') && (
c !=
'/') &&
3129 (((
c >=
'a') && (
c <=
'z')) ||
3130 ((
c >=
'A') && (
c <=
'Z')) ||
3131 ((
c >=
'0') && (
c <=
'9')) ||
3132 (
c ==
'_') || (
c ==
':') ||
3133 (
c ==
'-') || (
c ==
'.') || (
c == 0xB7) ||
3134 ((
c >= 0xC0) && (
c <= 0xD6)) ||
3135 ((
c >= 0xD8) && (
c <= 0xF6)) ||
3136 ((
c >= 0xF8) && (
c <= 0x2FF)) ||
3137 ((
c >= 0x300) && (
c <= 0x36F)) ||
3138 ((
c >= 0x370) && (
c <= 0x37D)) ||
3139 ((
c >= 0x37F) && (
c <= 0x1FFF)) ||
3140 ((
c >= 0x200C) && (
c <= 0x200D)) ||
3141 ((
c >= 0x203F) && (
c <= 0x2040)) ||
3142 ((
c >= 0x2070) && (
c <= 0x218F)) ||
3143 ((
c >= 0x2C00) && (
c <= 0x2FEF)) ||
3144 ((
c >= 0x3001) && (
c <= 0xD7FF)) ||
3145 ((
c >= 0xF900) && (
c <= 0xFDCF)) ||
3146 ((
c >= 0xFDF0) && (
c <= 0xFFFD)) ||
3147 ((
c >= 0x10000) && (
c <= 0xEFFFF))))
3151 (
c ==
'.') || (
c ==
'-') ||
3152 (
c ==
'_') || (
c ==
':') ||
3170 nbParseNameComplex++;
3185 if ((
c ==
' ') || (
c ==
'>') || (
c ==
'/') ||
3186 (!(((
c >=
'a') && (
c <=
'z')) ||
3187 ((
c >=
'A') && (
c <=
'Z')) ||
3188 (
c ==
'_') || (
c ==
':') ||
3189 ((
c >= 0xC0) && (
c <= 0xD6)) ||
3190 ((
c >= 0xD8) && (
c <= 0xF6)) ||
3191 ((
c >= 0xF8) && (
c <= 0x2FF)) ||
3192 ((
c >= 0x370) && (
c <= 0x37D)) ||
3193 ((
c >= 0x37F) && (
c <= 0x1FFF)) ||
3194 ((
c >= 0x200C) && (
c <= 0x200D)) ||
3195 ((
c >= 0x2070) && (
c <= 0x218F)) ||
3196 ((
c >= 0x2C00) && (
c <= 0x2FEF)) ||
3197 ((
c >= 0x3001) && (
c <= 0xD7FF)) ||
3198 ((
c >= 0xF900) && (
c <= 0xFDCF)) ||
3199 ((
c >= 0xFDF0) && (
c <= 0xFFFD)) ||
3200 ((
c >= 0x10000) && (
c <= 0xEFFFF))))) {
3206 while ((
c !=
' ') && (
c !=
'>') && (
c !=
'/') &&
3207 (((
c >=
'a') && (
c <=
'z')) ||
3208 ((
c >=
'A') && (
c <=
'Z')) ||
3209 ((
c >=
'0') && (
c <=
'9')) ||
3210 (
c ==
'_') || (
c ==
':') ||
3211 (
c ==
'-') || (
c ==
'.') || (
c == 0xB7) ||
3212 ((
c >= 0xC0) && (
c <= 0xD6)) ||
3213 ((
c >= 0xD8) && (
c <= 0xF6)) ||
3214 ((
c >= 0xF8) && (
c <= 0x2FF)) ||
3215 ((
c >= 0x300) && (
c <= 0x36F)) ||
3216 ((
c >= 0x370) && (
c <= 0x37D)) ||
3217 ((
c >= 0x37F) && (
c <= 0x1FFF)) ||
3218 ((
c >= 0x200C) && (
c <= 0x200D)) ||
3219 ((
c >= 0x203F) && (
c <= 0x2040)) ||
3220 ((
c >= 0x2070) && (
c <= 0x218F)) ||
3221 ((
c >= 0x2C00) && (
c <= 0x2FEF)) ||
3222 ((
c >= 0x3001) && (
c <= 0xD7FF)) ||
3223 ((
c >= 0xF900) && (
c <= 0xFDCF)) ||
3224 ((
c >= 0xFDF0) && (
c <= 0xFFFD)) ||
3225 ((
c >= 0x10000) && (
c <= 0xEFFFF))
3238 if ((
c ==
' ') || (
c ==
'>') || (
c ==
'/') ||
3247 while ((
c !=
' ') && (
c !=
'>') && (
c !=
'/') &&
3249 (
c ==
'.') || (
c ==
'-') ||
3250 (
c ==
'_') || (
c ==
':') ||
3276 "unexpected change of input buffer");
3316 if (((*
in >= 0x61) && (*
in <= 0x7A)) ||
3317 ((*
in >= 0x41) && (*
in <= 0x5A)) ||
3318 (*
in ==
'_') || (*
in ==
':')) {
3320 while (((*
in >= 0x61) && (*
in <= 0x7A)) ||
3321 ((*
in >= 0x41) && (*
in <= 0x5A)) ||
3322 ((*
in >= 0x30) && (*
in <= 0x39)) ||
3323 (*
in ==
'_') || (*
in ==
'-') ||
3324 (*
in ==
':') || (*
in ==
'.'))
3326 if ((*
in > 0) && (*
in < 0x80)) {
3351 size_t startPosition = 0;
3354 nbParseNCNameComplex++;
3363 if ((
c ==
' ') || (
c ==
'>') || (
c ==
'/') ||
3368 while ((
c !=
' ') && (
c !=
'>') && (
c !=
'/') &&
3437 if ((((*
in >= 0x61) && (*
in <= 0x7A)) ||
3438 ((*
in >= 0x41) && (*
in <= 0x5A)) ||
3439 (*
in ==
'_')) && (
in <
e)) {
3441 while ((((*
in >= 0x61) && (*
in <= 0x7A)) ||
3442 ((*
in >= 0x41) && (*
in <= 0x5A)) ||
3443 ((*
in >= 0x30) && (*
in <= 0x39)) ||
3444 (*
in ==
'_') || (*
in ==
'-') ||
3445 (*
in ==
'.')) && (
in <
e))
3449 if ((*
in > 0) && (*
in < 0x80)) {
3492 while (*
in != 0 && *
in == *
cmp) {
3537 nbParseStringName++;
3732 if (
RAW ==
'"') stop =
'"';
3733 else if (
RAW ==
'\'') stop =
'\'';
3803 if ((*
cur ==
'%') || ((*
cur ==
'&') && (
cur[1] !=
'#'))) {
3814 if ((nameOk == 0) || (*
cur !=
';')) {
3816 "EntityValue: '%c' forbidden except for entities references\n",
3820 if ((tmp ==
'%') && (ctxt->
inSubset == 1) &&
3872 size_t buf_size = 0;
3873 int c,
l, in_space = 0;
3877 if (
NXT(0) ==
'"') {
3881 }
else if (
NXT(0) ==
'\'') {
3895 if (
buf ==
NULL)
goto mem_error;
3911 "AttValue length too long\n");
3917 if (
NXT(1) ==
'#') {
3922 if (
len + 10 > buf_size) {
3931 if (
len + 10 > buf_size) {
3940 }
else if (
val != 0) {
3941 if (
len + 10 > buf_size) {
3951 if ((ent !=
NULL) &&
3953 if (
len + 10 > buf_size) {
3966 }
else if ((ent !=
NULL) &&
3983 if (
len + 10 > buf_size) {
3991 if (
len + 10 > buf_size) {
3997 }
else if (ent !=
NULL) {
4007 unsigned long oldnbent = ctxt->
nbentities, diff;
4032 while (
len +
i + 10 > buf_size) {
4041 if ((
c == 0x20) || (
c == 0xD) || (
c == 0xA) || (
c == 0x9)) {
4045 while (
len + 10 > buf_size) {
4054 if (
len + 10 > buf_size) {
4075 "invalid character in attribute value\n");
4078 "AttValue: ' expected\n");
4089 "AttValue length too long\n");
4171 }
else if (
RAW ==
'\'') {
4260 }
else if (
RAW ==
'\'') {
4327 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4328 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4329 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4330 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4331 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x00, 0x27,
4332 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
4333 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
4334 0x38, 0x39, 0x3A, 0x3B, 0x00, 0x3D, 0x3E, 0x3F,
4335 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
4336 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
4337 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
4338 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x00, 0x5E, 0x5F,
4339 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
4340 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
4341 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
4342 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
4343 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4344 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4345 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4346 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4347 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4348 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4349 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4350 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4351 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4352 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4353 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4354 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4355 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4356 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4357 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4358 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
4400 }
while (*
in == 0xA);
4401 goto get_more_space;
4410 (ctxt->
sax->ignorableWhitespace !=
4411 ctxt->
sax->characters)) {
4413 if (ctxt->
sax->ignorableWhitespace !=
NULL)
4417 if (ctxt->
sax->characters !=
NULL)
4420 if (*ctxt->
space == -1)
4423 }
else if ((ctxt->
sax !=
NULL) &&
4424 (ctxt->
sax->characters !=
NULL)) {
4443 }
while (*
in == 0xA);
4447 if ((
in[1] ==
']') && (
in[2] ==
'>')) {
4459 (ctxt->
sax->ignorableWhitespace !=
4460 ctxt->
sax->characters) &&
4466 if (ctxt->
sax->ignorableWhitespace !=
NULL)
4470 if (ctxt->
sax->characters !=
NULL)
4473 if (*ctxt->
space == -1)
4478 }
else if (ctxt->
sax !=
NULL) {
4479 if (ctxt->
sax->characters !=
NULL)
4511 }
while (((*
in >= 0x20) && (*
in <= 0x7F)) || (*
in == 0x09));
4538 while ((
cur !=
'<') &&
4541 if ((
cur ==
']') && (
NXT(1) ==
']') &&
4557 if (ctxt->
sax->ignorableWhitespace !=
NULL)
4561 if (ctxt->
sax->characters !=
NULL)
4563 if ((ctxt->
sax->characters !=
4564 ctxt->
sax->ignorableWhitespace) &&
4565 (*ctxt->
space == -1))
4591 if (ctxt->
sax->ignorableWhitespace !=
NULL)
4594 if (ctxt->
sax->characters !=
NULL)
4596 if ((ctxt->
sax->characters != ctxt->
sax->ignorableWhitespace) &&
4597 (*ctxt->
space == -1))
4605 "PCDATA invalid Char value %d\n",
4640 if (
CMP6(
CUR_PTR,
'S',
'Y',
'S',
'T',
'E',
'M')) {
4644 "Space required after 'SYSTEM'\n");
4650 }
else if (
CMP6(
CUR_PTR,
'P',
'U',
'B',
'L',
'I',
'C')) {
4654 "Space required after 'PUBLIC'\n");
4657 if (*publicID ==
NULL) {
4666 "Space required after the Public Identifier\n");
4676 if ((
CUR !=
'\'') && (
CUR !=
'"'))
return(
NULL);
4723 goto not_terminated;
4726 "xmlParseComment: invalid xmlChar value %d\n",
4734 goto not_terminated;
4737 "xmlParseComment: invalid xmlChar value %d\n",
4745 goto not_terminated;
4748 (
r !=
'-') || (
q !=
'-'))) {
4749 if ((
r ==
'-') && (
q ==
'-')) {
4755 "Comment too big found",
NULL);
4763 new_size =
size * 2;
4765 if (new_buf ==
NULL) {
4799 "Comment not terminated \n<!--%.50s\n",
buf);
4802 "xmlParseComment: invalid xmlChar value %d\n",
4805 if (inputid != ctxt->
input->
id) {
4807 "Comment doesn't start and stop in the same" 4819 "Comment not terminated\n",
NULL);
4848 if ((
RAW !=
'<') || (
NXT(1) !=
'!') ||
4849 (
NXT(2) !=
'-') || (
NXT(3) !=
'-'))
return;
4867 }
while (*
in == 0xA);
4871 while (((*
in >
'-') && (*
in <= 0x7F)) ||
4872 ((*
in >= 0x20) && (*
in <
'-')) ||
4882 }
while (*
in == 0xA);
4891 (ctxt->
sax->comment !=
NULL)) {
4893 if ((*
in ==
'-') && (
in[1] ==
'-'))
4904 }
else if (
len + nbchar + 1 >=
size) {
4909 if (new_buf ==
NULL) {
4925 "Comment too big found",
NULL);
4954 if (ctxt->
input->
id != inputid) {
4956 "comment doesn't start and stop in the" 4975 "Double hyphen within comment: " 4980 "Double hyphen within comment\n",
NULL);
4992 }
while (((*
in >= 0x20) && (*
in <= 0x7F)) || (*
in == 0x09));
5016 ((
name[0] ==
'x') || (
name[0] ==
'X')) &&
5017 ((
name[1] ==
'm') || (
name[1] ==
'M')) &&
5018 ((
name[2] ==
'l') || (
name[2] ==
'L'))) {
5020 if ((
name[0] ==
'x') && (
name[1] ==
'm') &&
5021 (
name[2] ==
'l') && (
name[3] == 0)) {
5023 "XML declaration allowed only at the start of the document\n");
5025 }
else if (
name[3] == 0) {