* xmlTextReaderReadInnerXml: * @reader: the xmlTextReaderPtr used * * Reads the contents of the current node, including child nodes and markup. * * Returns a string containing the XML content, or NULL if the current node * is neither an element nor attribute, or has no child nodes. The * string must be deallocated by the caller. */
| 1653 | * string must be deallocated by the caller. |
| 1654 | */ |
| 1655 | xmlChar * |
| 1656 | xmlTextReaderReadInnerXml(xmlTextReaderPtr reader) |
| 1657 | { |
| 1658 | xmlOutputBufferPtr output; |
| 1659 | xmlNodePtr cur; |
| 1660 | xmlChar *ret; |
| 1661 | |
| 1662 | if (xmlTextReaderExpand(reader) == NULL) |
| 1663 | return(NULL); |
| 1664 | |
| 1665 | if (reader->node == NULL) |
| 1666 | return(NULL); |
| 1667 | |
| 1668 | output = xmlAllocOutputBuffer(NULL); |
| 1669 | if (output == NULL) { |
| 1670 | xmlTextReaderErrMemory(reader); |
| 1671 | return(NULL); |
| 1672 | } |
| 1673 | |
| 1674 | for (cur = reader->node->children; cur != NULL; cur = cur->next) |
| 1675 | xmlTextReaderDumpCopy(reader, output, cur); |
| 1676 | |
| 1677 | if (output->error) |
| 1678 | xmlCtxtErrIO(reader->ctxt, output->error, NULL); |
| 1679 | |
| 1680 | ret = xmlBufDetach(output->buffer); |
| 1681 | xmlOutputBufferClose(output); |
| 1682 | |
| 1683 | return(ret); |
| 1684 | } |
| 1685 | |
| 1686 | /** |
| 1687 | * xmlTextReaderReadOuterXml: |
nothing calls this directly
no test coverage detected