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

Function htmlReadDoc

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:6368–6389  ·  view source on GitHub ↗

* htmlReadDoc: * @str: a pointer to a zero terminated string * @url: only used for error reporting (optoinal) * @encoding: the document encoding (optional) * @options: a combination of htmlParserOptions * * Convenience function to parse an HTML document from a zero-terminated * string. * * See htmlCtxtReadDoc for details. * * Returns the resulting document tree. */

Source from the content-addressed store, hash-verified

6366 * Returns the resulting document tree.
6367 */
6368htmlDocPtr
6369htmlReadDoc(const xmlChar *str, const char *url, const char *encoding,
6370 int options)
6371{
6372 htmlParserCtxtPtr ctxt;
6373 xmlParserInputPtr input;
6374 htmlDocPtr doc;
6375
6376 ctxt = htmlNewParserCtxt();
6377 if (ctxt == NULL)
6378 return(NULL);
6379
6380 htmlCtxtUseOptions(ctxt, options);
6381
6382 input = xmlNewInputString(ctxt, url, (const char *) str, encoding,
6383 XML_INPUT_BUF_STATIC);
6384
6385 doc = htmlCtxtParseDocument(ctxt, input);
6386
6387 htmlFreeParserCtxt(ctxt);
6388 return(doc);
6389}
6390
6391/**
6392 * htmlReadFile:

Callers

nothing calls this directly

Calls 5

htmlNewParserCtxtFunction · 0.85
htmlCtxtUseOptionsFunction · 0.85
xmlNewInputStringFunction · 0.85
htmlCtxtParseDocumentFunction · 0.85
htmlFreeParserCtxtFunction · 0.85

Tested by

no test coverage detected