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

Function xhtmlNodeDumpOutput

ThirdParty/libxml2/vtklibxml2/xmlsave.c:1662–1986  ·  view source on GitHub ↗

* xhtmlNodeDumpOutput: * @buf: the XML buffer output * @doc: the XHTML document * @cur: the current node * @level: the imbrication level for indenting * @format: is formatting allowed * @encoding: an optional encoding string * * Dump an XHTML node, recursive behaviour, children are printed too. */

Source from the content-addressed store, hash-verified

1660 * Dump an XHTML node, recursive behaviour, children are printed too.
1661 */
1662static void
1663xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
1664 int format = ctxt->format, addmeta, oldoptions;
1665 xmlNodePtr tmp, root, unformattedNode = NULL, parent;
1666 xmlChar *start, *end;
1667 xmlOutputBufferPtr buf = ctxt->buf;
1668
1669 if (cur == NULL) return;
1670
1671 oldoptions = ctxt->options;
1672 ctxt->options |= XML_SAVE_XHTML;
1673
1674 root = cur;
1675 parent = cur->parent;
1676 while (1) {
1677 switch (cur->type) {
1678 case XML_DOCUMENT_NODE:
1679 case XML_HTML_DOCUMENT_NODE:
1680 xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
1681 break;
1682
1683 case XML_NAMESPACE_DECL:
1684 xmlNsDumpOutput(buf, NULL, (xmlNsPtr) cur, ctxt);
1685 break;
1686
1687 case XML_DTD_NODE:
1688 xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
1689 break;
1690
1691 case XML_DOCUMENT_FRAG_NODE:
1692 /* Always validate cur->parent when descending. */
1693 if ((cur->parent == parent) && (cur->children != NULL)) {
1694 parent = cur;
1695 cur = cur->children;
1696 continue;
1697 }
1698 break;
1699
1700 case XML_ELEMENT_DECL:
1701 xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
1702 break;
1703
1704 case XML_ATTRIBUTE_DECL:
1705 xmlBufDumpAttributeDecl(buf, (xmlAttributePtr) cur);
1706 break;
1707
1708 case XML_ENTITY_DECL:
1709 xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
1710 break;
1711
1712 case XML_ELEMENT_NODE:
1713 addmeta = 0;
1714
1715 if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
1716 xmlOutputBufferWrite(buf, ctxt->indent_size *
1717 (ctxt->level > ctxt->indent_nr ?
1718 ctxt->indent_nr : ctxt->level),
1719 ctxt->indent);

Callers 3

xmlDocContentDumpOutputFunction · 0.85
xmlSaveTreeFunction · 0.85
xmlNodeDumpOutputFunction · 0.85

Calls 15

xmlDocContentDumpOutputFunction · 0.85
xmlNsDumpOutputFunction · 0.85
xmlDtdDumpOutputFunction · 0.85
xmlBufDumpElementDeclFunction · 0.85
xmlBufDumpAttributeDeclFunction · 0.85
xmlBufDumpEntityDeclFunction · 0.85
xmlOutputBufferWriteFunction · 0.85
xmlNsListDumpOutputCtxtFunction · 0.85
xmlStrEqualFunction · 0.85
xhtmlAttrListDumpOutputFunction · 0.85
xmlGetPropFunction · 0.85

Tested by

no test coverage detected