MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlParseExtParsedEnt

Function xmlParseExtParsedEnt

ThirdParty/libxml2/vtklibxml2/parser.c:10713–10768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10711 */
10712
10713int
10714xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) {
10715 if ((ctxt == NULL) || (ctxt->input == NULL))
10716 return(-1);
10717
10718 xmlCtxtInitializeLate(ctxt);
10719
10720 if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
10721 ctxt->sax->setDocumentLocator(ctxt->userData,
10722 (xmlSAXLocator *) &xmlDefaultSAXLocator);
10723 }
10724
10725 xmlDetectEncoding(ctxt);
10726
10727 if (CUR == 0) {
10728 xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
10729 }
10730
10731 /*
10732 * Check for the XMLDecl in the Prolog.
10733 */
10734 GROW;
10735 if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
10736
10737 /*
10738 * Note that we will switch encoding on the fly.
10739 */
10740 xmlParseXMLDecl(ctxt);
10741 SKIP_BLANKS;
10742 } else {
10743 ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
10744 }
10745 if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX))
10746 ctxt->sax->startDocument(ctxt->userData);
10747
10748 /*
10749 * Doing validity checking on chunk doesn't make sense
10750 */
10751 ctxt->options &= ~XML_PARSE_DTDVALID;
10752 ctxt->validate = 0;
10753 ctxt->depth = 0;
10754
10755 xmlParseContentInternal(ctxt);
10756
10757 if (ctxt->input->cur < ctxt->input->end)
10758 xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
10759
10760 /*
10761 * SAX: end of the document processing.
10762 */
10763 if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
10764 ctxt->sax->endDocument(ctxt->userData);
10765
10766 if (! ctxt->wellFormed) return(-1);
10767 return(0);
10768}
10769
10770#ifdef LIBXML_PUSH_ENABLED

Callers 1

xmlSAXParseEntityFunction · 0.85

Calls 6

xmlCtxtInitializeLateFunction · 0.85
xmlDetectEncodingFunction · 0.85
xmlFatalErrFunction · 0.85
xmlParseXMLDeclFunction · 0.85
xmlCharStrdupFunction · 0.85
xmlParseContentInternalFunction · 0.85

Tested by

no test coverage detected