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

Function xmlTextReaderDumpCopy

ThirdParty/libxml2/vtklibxml2/xmlreader.c:1614–1643  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1612
1613#ifdef LIBXML_WRITER_ENABLED
1614static void
1615xmlTextReaderDumpCopy(xmlTextReaderPtr reader, xmlOutputBufferPtr output,
1616 xmlNodePtr node) {
1617 if ((node->type == XML_DTD_NODE) ||
1618 (node->type == XML_ELEMENT_DECL) ||
1619 (node->type == XML_ATTRIBUTE_DECL) ||
1620 (node->type == XML_ENTITY_DECL))
1621 return;
1622
1623 if ((node->type == XML_DOCUMENT_NODE) ||
1624 (node->type == XML_HTML_DOCUMENT_NODE)) {
1625 xmlNodeDumpOutput(output, node->doc, node, 0, 0, NULL);
1626 } else {
1627 xmlNodePtr copy;
1628
1629 /*
1630 * Create a copy to make sure that namespace declarations from
1631 * ancestors are added.
1632 */
1633 copy = xmlDocCopyNode(node, node->doc, 1);
1634 if (copy == NULL) {
1635 xmlTextReaderErrMemory(reader);
1636 return;
1637 }
1638
1639 xmlNodeDumpOutput(output, copy->doc, copy, 0, 0, NULL);
1640
1641 xmlFreeNode(copy);
1642 }
1643}
1644
1645/**
1646 * xmlTextReaderReadInnerXml:

Callers 2

Calls 4

xmlNodeDumpOutputFunction · 0.85
xmlDocCopyNodeFunction · 0.85
xmlTextReaderErrMemoryFunction · 0.85
xmlFreeNodeFunction · 0.85

Tested by

no test coverage detected