* xmlTextReaderReadOuterXml: * @reader: the xmlTextReaderPtr used * * Reads the contents of the current node, including child nodes and markup. * * Returns a string containing the node and any XML content, or NULL if the * current node cannot be serialized. The string must be deallocated * by the caller. */
| 1694 | * by the caller. |
| 1695 | */ |
| 1696 | xmlChar * |
| 1697 | xmlTextReaderReadOuterXml(xmlTextReaderPtr reader) |
| 1698 | { |
| 1699 | xmlOutputBufferPtr output; |
| 1700 | xmlNodePtr node; |
| 1701 | xmlChar *ret; |
| 1702 | |
| 1703 | if (xmlTextReaderExpand(reader) == NULL) |
| 1704 | return(NULL); |
| 1705 | |
| 1706 | node = reader->node; |
| 1707 | if (node == NULL) |
| 1708 | return(NULL); |
| 1709 | |
| 1710 | output = xmlAllocOutputBuffer(NULL); |
| 1711 | if (output == NULL) { |
| 1712 | xmlTextReaderErrMemory(reader); |
| 1713 | return(NULL); |
| 1714 | } |
| 1715 | |
| 1716 | xmlTextReaderDumpCopy(reader, output, node); |
| 1717 | if (output->error) |
| 1718 | xmlCtxtErrIO(reader->ctxt, output->error, NULL); |
| 1719 | |
| 1720 | ret = xmlBufDetach(output->buffer); |
| 1721 | xmlOutputBufferClose(output); |
| 1722 | |
| 1723 | return(ret); |
| 1724 | } |
| 1725 | #endif |
| 1726 | |
| 1727 | /** |
nothing calls this directly
no test coverage detected