mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-08 17:42:14 +03:00
handling of PIs and <?sgml-declaration in entities. Daniel
* DOCBparser.c: handling of PIs and <?sgml-declaration in entities. Daniel
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
Mon Jun 11 19:29:40 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||
|
||||
* DOCBparser.c: handling of PIs and <?sgml-declaration in entities.
|
||||
|
||||
Tue Jun 12 08:46:28 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||
|
||||
* valid.c: fixed bug #56049, forgot one check in the
|
||||
|
31
DOCBparser.c
31
DOCBparser.c
@@ -4135,9 +4135,9 @@ docbParseReference(docbParserCtxtPtr ctxt) {
|
||||
* Parse a content: comment, sub-element, reference or text.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
docbParseContent(docbParserCtxtPtr ctxt) {
|
||||
docbParseContent(docbParserCtxtPtr ctxt)
|
||||
{
|
||||
xmlChar *currentNode;
|
||||
int depth;
|
||||
|
||||
@@ -4152,7 +4152,8 @@ docbParseContent(docbParserCtxtPtr ctxt) {
|
||||
*/
|
||||
if ((CUR == '<') && (NXT(1) == '/')) {
|
||||
docbParseEndTag(ctxt);
|
||||
if (currentNode != NULL) xmlFree(currentNode);
|
||||
if (currentNode != NULL)
|
||||
xmlFree(currentNode);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4162,7 +4163,8 @@ docbParseContent(docbParserCtxtPtr ctxt) {
|
||||
*/
|
||||
if ((!xmlStrEqual(currentNode, ctxt->name)) &&
|
||||
(depth >= ctxt->nameNr)) {
|
||||
if (currentNode != NULL) xmlFree(currentNode);
|
||||
if (currentNode != NULL)
|
||||
xmlFree(currentNode);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4172,8 +4174,7 @@ docbParseContent(docbParserCtxtPtr ctxt) {
|
||||
if ((CUR == '<') && (NXT(1) == '!') &&
|
||||
(UPP(2) == 'D') && (UPP(3) == 'O') &&
|
||||
(UPP(4) == 'C') && (UPP(5) == 'T') &&
|
||||
(UPP(6) == 'Y') && (UPP(7) == 'P') &&
|
||||
(UPP(8) == 'E')) {
|
||||
(UPP(6) == 'Y') && (UPP(7) == 'P') && (UPP(8) == 'E')) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"Misplaced DOCTYPE declaration\n");
|
||||
@@ -4190,14 +4191,21 @@ docbParseContent(docbParserCtxtPtr ctxt) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Second case : a sub-element.
|
||||
* Second case : a PI
|
||||
*/
|
||||
else if ((RAW == '<') && (NXT(1) == '?')) {
|
||||
docbParsePI(ctxt);
|
||||
}
|
||||
|
||||
/*
|
||||
* Third case : a sub-element.
|
||||
*/
|
||||
else if (CUR == '<') {
|
||||
docbParseElement(ctxt);
|
||||
}
|
||||
|
||||
/*
|
||||
* Third case : a reference. If if has not been resolved,
|
||||
* Fourth case : a reference. If if has not been resolved,
|
||||
* parsing returns it's Name, create the node
|
||||
*/
|
||||
else if (CUR == '&') {
|
||||
@@ -4205,7 +4213,7 @@ docbParseContent(docbParserCtxtPtr ctxt) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Fourth : end of the resource
|
||||
* Fifth : end of the resource
|
||||
*/
|
||||
else if (CUR == 0) {
|
||||
docbAutoClose(ctxt, NULL);
|
||||
@@ -4232,7 +4240,8 @@ docbParseContent(docbParserCtxtPtr ctxt) {
|
||||
|
||||
GROW;
|
||||
}
|
||||
if (currentNode != NULL) xmlFree(currentNode);
|
||||
if (currentNode != NULL)
|
||||
xmlFree(currentNode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4822,7 +4831,7 @@ docbParseMisc(xmlParserCtxtPtr ctxt) {
|
||||
(NXT(2) == '-') && (NXT(3) == '-')) ||
|
||||
IS_BLANK(CUR)) {
|
||||
if ((RAW == '<') && (NXT(1) == '?')) {
|
||||
docbParsePI(ctxt); /* TODO: SGML PIs differs */
|
||||
docbParsePI(ctxt);
|
||||
} else if (IS_BLANK(CUR)) {
|
||||
NEXT;
|
||||
} else
|
||||
|
Reference in New Issue
Block a user