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

Function xmlTextReaderReadInnerXml

ThirdParty/libxml2/vtklibxml2/xmlreader.c:1655–1684  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1653 * string must be deallocated by the caller.
1654 */
1655xmlChar *
1656xmlTextReaderReadInnerXml(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:

Callers

nothing calls this directly

Calls 7

xmlTextReaderExpandFunction · 0.85
xmlAllocOutputBufferFunction · 0.85
xmlTextReaderErrMemoryFunction · 0.85
xmlTextReaderDumpCopyFunction · 0.85
xmlCtxtErrIOFunction · 0.85
xmlBufDetachFunction · 0.85
xmlOutputBufferCloseFunction · 0.85

Tested by

no test coverage detected