* xmlSAX2EndDocument: * @ctx: the user data (XML parser context) * * called when the document end has been detected. */
| 861 | * called when the document end has been detected. |
| 862 | */ |
| 863 | void |
| 864 | xmlSAX2EndDocument(void *ctx) |
| 865 | { |
| 866 | xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
| 867 | xmlDocPtr doc; |
| 868 | |
| 869 | if (ctx == NULL) return; |
| 870 | #ifdef LIBXML_VALID_ENABLED |
| 871 | if (ctxt->validate && ctxt->wellFormed && |
| 872 | ctxt->myDoc && ctxt->myDoc->intSubset) |
| 873 | ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc); |
| 874 | #endif /* LIBXML_VALID_ENABLED */ |
| 875 | |
| 876 | doc = ctxt->myDoc; |
| 877 | if ((doc != NULL) && (doc->encoding == NULL)) { |
| 878 | const xmlChar *encoding = xmlGetActualEncoding(ctxt); |
| 879 | |
| 880 | if (encoding != NULL) { |
| 881 | doc->encoding = xmlStrdup(encoding); |
| 882 | if (doc->encoding == NULL) |
| 883 | xmlSAX2ErrMemory(ctxt); |
| 884 | } |
| 885 | } |
| 886 | } |
| 887 | |
| 888 | static void |
| 889 | xmlSAX2AppendChild(xmlParserCtxtPtr ctxt, xmlNodePtr node) { |
no test coverage detected