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

Function xmlShellCat

ThirdParty/libxml2/vtklibxml2/debugXML.c:2397–2427  ·  view source on GitHub ↗

* xmlShellCat: * @ctxt: the shell context * @arg: unused * @node: a node * @node2: unused * * Implements the XML shell function "cat" * dumps the serialization node content (XML or HTML). * * Returns 0 */

Source from the content-addressed store, hash-verified

2395 * Returns 0
2396 */
2397int
2398xmlShellCat(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED,
2399 xmlNodePtr node, xmlNodePtr node2 ATTRIBUTE_UNUSED)
2400{
2401 if (!ctxt)
2402 return (0);
2403 if (node == NULL) {
2404 fprintf(ctxt->output, "NULL\n");
2405 return (0);
2406 }
2407 if (ctxt->doc->type == XML_HTML_DOCUMENT_NODE) {
2408#ifdef LIBXML_HTML_ENABLED
2409 if (node->type == XML_HTML_DOCUMENT_NODE)
2410 htmlDocDump(ctxt->output, (htmlDocPtr) node);
2411 else
2412 htmlNodeDumpFile(ctxt->output, ctxt->doc, node);
2413#else
2414 if (node->type == XML_DOCUMENT_NODE)
2415 xmlDocDump(ctxt->output, (xmlDocPtr) node);
2416 else
2417 xmlElemDump(ctxt->output, ctxt->doc, node);
2418#endif /* LIBXML_HTML_ENABLED */
2419 } else {
2420 if (node->type == XML_DOCUMENT_NODE)
2421 xmlDocDump(ctxt->output, (xmlDocPtr) node);
2422 else
2423 xmlElemDump(ctxt->output, ctxt->doc, node);
2424 }
2425 fprintf(ctxt->output, "\n");
2426 return (0);
2427}
2428#endif /* LIBXML_OUTPUT_ENABLED */
2429
2430/**

Callers 1

xmlShellFunction · 0.85

Calls 5

fprintfFunction · 0.85
htmlDocDumpFunction · 0.85
htmlNodeDumpFileFunction · 0.85
xmlDocDumpFunction · 0.85
xmlElemDumpFunction · 0.85

Tested by

no test coverage detected