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

Function xhtmlAttrListDumpOutput

ThirdParty/libxml2/vtklibxml2/xmlsave.c:1589–1649  ·  view source on GitHub ↗

* xhtmlAttrListDumpOutput: * @cur: the first attribute pointer * * Dump a list of XML attributes */

Source from the content-addressed store, hash-verified

1587 * Dump a list of XML attributes
1588 */
1589static void
1590xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
1591 xmlAttrPtr xml_lang = NULL;
1592 xmlAttrPtr lang = NULL;
1593 xmlAttrPtr name = NULL;
1594 xmlAttrPtr id = NULL;
1595 xmlNodePtr parent;
1596 xmlOutputBufferPtr buf;
1597
1598 if (cur == NULL) return;
1599 buf = ctxt->buf;
1600 parent = cur->parent;
1601 while (cur != NULL) {
1602 if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "id")))
1603 id = cur;
1604 else
1605 if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "name")))
1606 name = cur;
1607 else
1608 if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")))
1609 lang = cur;
1610 else
1611 if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) &&
1612 (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml")))
1613 xml_lang = cur;
1614 xmlAttrDumpOutput(ctxt, cur);
1615 cur = cur->next;
1616 }
1617 /*
1618 * C.8
1619 */
1620 if ((name != NULL) && (id == NULL)) {
1621 if ((parent != NULL) && (parent->name != NULL) &&
1622 ((xmlStrEqual(parent->name, BAD_CAST "a")) ||
1623 (xmlStrEqual(parent->name, BAD_CAST "p")) ||
1624 (xmlStrEqual(parent->name, BAD_CAST "div")) ||
1625 (xmlStrEqual(parent->name, BAD_CAST "img")) ||
1626 (xmlStrEqual(parent->name, BAD_CAST "map")) ||
1627 (xmlStrEqual(parent->name, BAD_CAST "applet")) ||
1628 (xmlStrEqual(parent->name, BAD_CAST "form")) ||
1629 (xmlStrEqual(parent->name, BAD_CAST "frame")) ||
1630 (xmlStrEqual(parent->name, BAD_CAST "iframe")))) {
1631 xmlOutputBufferWrite(buf, 5, " id=\"");
1632 xmlAttrSerializeContent(buf, name);
1633 xmlOutputBufferWrite(buf, 1, "\"");
1634 }
1635 }
1636 /*
1637 * C.7.
1638 */
1639 if ((lang != NULL) && (xml_lang == NULL)) {
1640 xmlOutputBufferWrite(buf, 11, " xml:lang=\"");
1641 xmlAttrSerializeContent(buf, lang);
1642 xmlOutputBufferWrite(buf, 1, "\"");
1643 } else
1644 if ((xml_lang != NULL) && (lang == NULL)) {
1645 xmlOutputBufferWrite(buf, 7, " lang=\"");
1646 xmlAttrSerializeContent(buf, xml_lang);

Callers 1

xhtmlNodeDumpOutputFunction · 0.85

Calls 4

xmlStrEqualFunction · 0.85
xmlAttrDumpOutputFunction · 0.85
xmlOutputBufferWriteFunction · 0.85
xmlAttrSerializeContentFunction · 0.85

Tested by

no test coverage detected