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

Function xmlTextReaderReadOuterXml

ThirdParty/libxml2/vtklibxml2/xmlreader.c:1696–1724  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1694 * by the caller.
1695 */
1696xmlChar *
1697xmlTextReaderReadOuterXml(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/**

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