| 1612 | |
| 1613 | #ifdef LIBXML_WRITER_ENABLED |
| 1614 | static void |
| 1615 | xmlTextReaderDumpCopy(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: |
no test coverage detected