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

Function htmlCtxtParseDocument

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:6319–6352  ·  view source on GitHub ↗

* htmlCtxtParseDocument: * @ctxt: an HTML parser context * @input: parser input * * Parse an HTML document and return the resulting document tree. * * Available since 2.13.0. * * Returns the resulting document tree or NULL */

Source from the content-addressed store, hash-verified

6317 * Returns the resulting document tree or NULL
6318 */
6319htmlDocPtr
6320htmlCtxtParseDocument(htmlParserCtxtPtr ctxt, xmlParserInputPtr input)
6321{
6322 htmlDocPtr ret;
6323
6324 if ((ctxt == NULL) || (input == NULL))
6325 return(NULL);
6326
6327 /* assert(ctxt->inputNr == 0); */
6328 while (ctxt->inputNr > 0)
6329 xmlFreeInputStream(inputPop(ctxt));
6330
6331 if (inputPush(ctxt, input) < 0) {
6332 xmlFreeInputStream(input);
6333 return(NULL);
6334 }
6335
6336 ctxt->html = 1;
6337 htmlParseDocument(ctxt);
6338
6339 if (ctxt->errNo != XML_ERR_NO_MEMORY) {
6340 ret = ctxt->myDoc;
6341 } else {
6342 ret = NULL;
6343 xmlFreeDoc(ctxt->myDoc);
6344 }
6345 ctxt->myDoc = NULL;
6346
6347 /* assert(ctxt->inputNr == 1); */
6348 while (ctxt->inputNr > 0)
6349 xmlFreeInputStream(inputPop(ctxt));
6350
6351 return(ret);
6352}
6353
6354/**
6355 * htmlReadDoc:

Callers 10

htmlReadDocFunction · 0.85
htmlReadFileFunction · 0.85
htmlReadMemoryFunction · 0.85
htmlReadFdFunction · 0.85
htmlReadIOFunction · 0.85
htmlCtxtReadDocFunction · 0.85
htmlCtxtReadFileFunction · 0.85
htmlCtxtReadMemoryFunction · 0.85
htmlCtxtReadFdFunction · 0.85
htmlCtxtReadIOFunction · 0.85

Calls 5

xmlFreeInputStreamFunction · 0.85
inputPopFunction · 0.85
inputPushFunction · 0.85
htmlParseDocumentFunction · 0.85
xmlFreeDocFunction · 0.85

Tested by

no test coverage detected