* 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 */
| 7339 | * Returns the cleaned up document or NULL in case of error |
| 7340 | */ |
| 7341 | static xmlDocPtr |
| 7342 | xmlRelaxNGCleanupDoc(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: |
no test coverage detected