* xmlAttrDumpOutput: * @buf: the XML buffer output * @cur: the attribute pointer * * Dump an XML attribute */
| 989 | * Dump an XML attribute |
| 990 | */ |
| 991 | static void |
| 992 | xmlAttrDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) { |
| 993 | xmlOutputBufferPtr buf; |
| 994 | |
| 995 | if (cur == NULL) return; |
| 996 | buf = ctxt->buf; |
| 997 | if (buf == NULL) return; |
| 998 | if (ctxt->format == 2) |
| 999 | xmlOutputBufferWriteWSNonSig(ctxt, 2); |
| 1000 | else |
| 1001 | xmlOutputBufferWrite(buf, 1, " "); |
| 1002 | if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { |
| 1003 | xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); |
| 1004 | xmlOutputBufferWrite(buf, 1, ":"); |
| 1005 | } |
| 1006 | xmlOutputBufferWriteString(buf, (const char *)cur->name); |
| 1007 | xmlOutputBufferWrite(buf, 2, "=\""); |
| 1008 | #ifdef LIBXML_HTML_ENABLED |
| 1009 | if ((ctxt->options & XML_SAVE_XHTML) && |
| 1010 | (cur->ns == NULL) && |
| 1011 | ((cur->children == NULL) || |
| 1012 | (cur->children->content == NULL) || |
| 1013 | (cur->children->content[0] == 0)) && |
| 1014 | (htmlIsBooleanAttr(cur->name))) { |
| 1015 | xmlOutputBufferWriteString(buf, (const char *) cur->name); |
| 1016 | } else |
| 1017 | #endif |
| 1018 | { |
| 1019 | xmlAttrSerializeContent(buf, cur); |
| 1020 | } |
| 1021 | xmlOutputBufferWrite(buf, 1, "\""); |
| 1022 | } |
| 1023 | |
| 1024 | #ifdef LIBXML_HTML_ENABLED |
| 1025 | /** |
no test coverage detected