version 1.21, 1999/10/23 21:43:49
|
version 1.22, 1999/10/26 08:18:05
|
Line 1689 htmlParseComment(htmlParserCtxtPtr ctxt,
|
Line 1689 htmlParseComment(htmlParserCtxtPtr ctxt,
|
while (IS_CHAR(CUR) && |
while (IS_CHAR(CUR) && |
((CUR == ':') || (CUR != '>') || |
((CUR == ':') || (CUR != '>') || |
(*r != '-') || (*q != '-'))) { |
(*r != '-') || (*q != '-'))) { |
if ((*r == '-') && (*q == '-')) { |
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) |
|
ctxt->sax->error(ctxt->userData, |
|
"Comment must not contain '--' (double-hyphen)`\n"); |
|
ctxt->wellFormed = 0; |
|
} |
|
NEXT;r++;q++; |
NEXT;r++;q++; |
} |
} |
if (!IS_CHAR(CUR)) { |
if (!IS_CHAR(CUR)) { |
Line 2261 htmlParseContent(htmlParserCtxtPtr ctxt)
|
Line 2255 htmlParseContent(htmlParserCtxtPtr ctxt)
|
} |
} |
|
|
if (test == CUR_PTR) { |
if (test == CUR_PTR) { |
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) |
if (ctxt->node != NULL) { |
ctxt->sax->error(ctxt->userData, |
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) |
"detected an error in element content\n"); |
ctxt->sax->error(ctxt->userData, |
ctxt->wellFormed = 0; |
"detected an error in element content\n"); |
|
ctxt->wellFormed = 0; |
|
} |
break; |
break; |
} |
} |
|
|
Line 2472 htmlParseDocument(htmlParserCtxtPtr ctxt
|
Line 2468 htmlParseDocument(htmlParserCtxtPtr ctxt
|
/* |
/* |
* Wipe out everything which is before the first '<' |
* Wipe out everything which is before the first '<' |
*/ |
*/ |
if (IS_BLANK(CUR)) { |
SKIP_BLANKS; |
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) |
|
ctxt->sax->error(ctxt->userData, |
|
"Extra spaces at the beginning of the document are not allowed\n"); |
|
ctxt->wellFormed = 0; |
|
SKIP_BLANKS; |
|
} |
|
|
|
if (CUR == 0) { |
if (CUR == 0) { |
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) |
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) |
ctxt->sax->error(ctxt->userData, "Document is empty\n"); |
ctxt->sax->error(ctxt->userData, "Document is empty\n"); |
ctxt->wellFormed = 0; |
ctxt->wellFormed = 0; |
} |
} |
|
|
|
/* |
|
* Parse possible comments before any content |
|
*/ |
|
while ((CUR == '<') && (NXT(1) == '!') && |
|
(NXT(2) == '-') && (NXT(3) == '-')) { |
|
ctxt->myDoc = htmlNewDoc(NULL, NULL); |
|
htmlParseComment(ctxt, 1); |
|
SKIP_BLANKS; |
|
} |
|
|
|
|
/* |
/* |
* Then possibly doc type declaration(s) and more Misc |
* Then possibly doc type declaration(s) and more Misc |
Line 2510 htmlParseDocument(htmlParserCtxtPtr ctxt
|
Line 2509 htmlParseDocument(htmlParserCtxtPtr ctxt
|
/* |
/* |
* Time to start parsing the tree itself |
* Time to start parsing the tree itself |
*/ |
*/ |
htmlParseElement(ctxt); |
htmlParseContent(ctxt); |
|
|
/* |
/* |
* SAX: end of the document processing. |
* SAX: end of the document processing. |