| 10535 | } |
| 10536 | |
| 10537 | static void |
| 10538 | xmlFinishDocument(xmlParserCtxtPtr ctxt) { |
| 10539 | xmlDocPtr doc; |
| 10540 | |
| 10541 | /* |
| 10542 | * SAX: end of the document processing. |
| 10543 | */ |
| 10544 | if ((ctxt->sax) && (ctxt->sax->endDocument != NULL)) |
| 10545 | ctxt->sax->endDocument(ctxt->userData); |
| 10546 | |
| 10547 | doc = ctxt->myDoc; |
| 10548 | if (doc != NULL) { |
| 10549 | if (ctxt->wellFormed) { |
| 10550 | doc->properties |= XML_DOC_WELLFORMED; |
| 10551 | if (ctxt->valid) |
| 10552 | doc->properties |= XML_DOC_DTDVALID; |
| 10553 | if (ctxt->nsWellFormed) |
| 10554 | doc->properties |= XML_DOC_NSVALID; |
| 10555 | } |
| 10556 | |
| 10557 | if (ctxt->options & XML_PARSE_OLD10) |
| 10558 | doc->properties |= XML_DOC_OLD10; |
| 10559 | |
| 10560 | /* |
| 10561 | * Remove locally kept entity definitions if the tree was not built |
| 10562 | */ |
| 10563 | if (xmlStrEqual(doc->version, SAX_COMPAT_MODE)) { |
| 10564 | xmlFreeDoc(doc); |
| 10565 | ctxt->myDoc = NULL; |
| 10566 | } |
| 10567 | } |
| 10568 | } |
| 10569 | |
| 10570 | /** |
| 10571 | * xmlParseDocument: |
no test coverage detected