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

Function xmlNodeSetLang

ThirdParty/libxml2/vtklibxml2/tree.c:5127–5144  ·  view source on GitHub ↗

* xmlNodeSetLang: * @cur: the node being changed * @lang: the language description * * Set the language of a node, i.e. the values of the xml:lang * attribute. * * Return 0 on success, 1 if arguments are invalid, -1 if a * memory allocation failed. */

Source from the content-addressed store, hash-verified

5125 * memory allocation failed.
5126 */
5127int
5128xmlNodeSetLang(xmlNodePtr cur, const xmlChar *lang) {
5129 xmlNsPtr ns;
5130 xmlAttrPtr attr;
5131 int res;
5132
5133 if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
5134 return(1);
5135
5136 res = xmlSearchNsByHrefSafe(cur, XML_XML_NAMESPACE, &ns);
5137 if (res != 0)
5138 return(res);
5139 attr = xmlSetNsProp(cur, ns, BAD_CAST "lang", lang);
5140 if (attr == NULL)
5141 return(-1);
5142
5143 return(0);
5144}
5145#endif /* LIBXML_TREE_ENABLED */
5146
5147/**

Callers

nothing calls this directly

Calls 2

xmlSearchNsByHrefSafeFunction · 0.85
xmlSetNsPropFunction · 0.85

Tested by

no test coverage detected