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

Function xmlRelaxNGCleanupDoc

ThirdParty/libxml2/vtklibxml2/relaxng.c:7341–7357  ·  view source on GitHub ↗

* xmlRelaxNGCleanupDoc: * @ctxt: a Relax-NG parser context * @doc: an xmldocPtr document pointer * * Cleanup the document from unwanted nodes for parsing, resolve * Include and externalRef lookups. * * Returns the cleaned up document or NULL in case of error */

Source from the content-addressed store, hash-verified

7339 * Returns the cleaned up document or NULL in case of error
7340 */
7341static xmlDocPtr
7342xmlRelaxNGCleanupDoc(xmlRelaxNGParserCtxtPtr ctxt, xmlDocPtr doc)
7343{
7344 xmlNodePtr root;
7345
7346 /*
7347 * Extract the root
7348 */
7349 root = xmlDocGetRootElement(doc);
7350 if (root == NULL) {
7351 xmlRngPErr(ctxt, (xmlNodePtr) doc, XML_RNGP_EMPTY, "xmlRelaxNGParse: %s is empty\n",
7352 ctxt->URL, NULL);
7353 return (NULL);
7354 }
7355 xmlRelaxNGCleanupTree(ctxt, root);
7356 return (doc);
7357}
7358
7359/**
7360 * xmlRelaxNGParse:

Callers 3

xmlRelaxNGLoadIncludeFunction · 0.85
xmlRelaxNGParseFunction · 0.85

Calls 2

xmlDocGetRootElementFunction · 0.85
xmlRelaxNGCleanupTreeFunction · 0.85

Tested by

no test coverage detected