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

Function xmlNsDumpOutput

ThirdParty/libxml2/vtklibxml2/xmlsave.c:872–895  ·  view source on GitHub ↗

* xmlNsDumpOutput: * @buf: the XML buffer output * @cur: a namespace * @ctxt: the output save context. Optional. * * Dump a local Namespace definition. * Should be called in the context of attributes dumps. * If @ctxt is supplied, @buf should be its buffer. */

Source from the content-addressed store, hash-verified

870 * If @ctxt is supplied, @buf should be its buffer.
871 */
872static void
873xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNsPtr cur,
874 xmlSaveCtxtPtr ctxt) {
875 if ((cur == NULL) || (buf == NULL)) return;
876 if ((cur->type == XML_LOCAL_NAMESPACE) && (cur->href != NULL)) {
877 if (xmlStrEqual(cur->prefix, BAD_CAST "xml"))
878 return;
879
880 if (ctxt != NULL && ctxt->format == 2)
881 xmlOutputBufferWriteWSNonSig(ctxt, 2);
882 else
883 xmlOutputBufferWrite(buf, 1, " ");
884
885 /* Within the context of an element attributes */
886 if (cur->prefix != NULL) {
887 xmlOutputBufferWrite(buf, 6, "xmlns:");
888 xmlOutputBufferWriteString(buf, (const char *)cur->prefix);
889 } else
890 xmlOutputBufferWrite(buf, 5, "xmlns");
891 xmlOutputBufferWrite(buf, 2, "=\"");
892 xmlBufAttrSerializeTxtContent(buf, doc, cur->href);
893 xmlOutputBufferWrite(buf, 1, "\"");
894 }
895}
896
897/**
898 * xmlNsListDumpOutputCtxt

Callers 4

xmlNsListDumpOutputCtxtFunction · 0.85
xmlNsListDumpOutputFunction · 0.85
xhtmlNodeDumpOutputFunction · 0.85

Calls 5

xmlStrEqualFunction · 0.85
xmlOutputBufferWriteFunction · 0.85

Tested by

no test coverage detected