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

Function xmlNewDocNodeEatName

ThirdParty/libxml2/vtklibxml2/tree.c:2188–2207  ·  view source on GitHub ↗

* xmlNewDocNodeEatName: * @doc: the target document * @ns: namespace (optional) * @name: the node name * @content: text content with XML references (optional) * * Create an element node. * * Like xmlNewDocNode, but the @name string will be used directly * without making a copy. Takes ownership of @name which will also * be freed on error. * * Returns a pointer to the new node objec

Source from the content-addressed store, hash-verified

2186 * invalid or a memory allocation failed.
2187 */
2188xmlNodePtr
2189xmlNewDocNodeEatName(xmlDocPtr doc, xmlNsPtr ns,
2190 xmlChar *name, const xmlChar *content) {
2191 xmlNodePtr cur;
2192
2193 if (name == NULL)
2194 return(NULL);
2195
2196 cur = xmlNewElem(doc, ns, name, content);
2197 if (cur == NULL) {
2198 /* if name doesn't come from the doc dictionary free it here */
2199 if ((doc == NULL) ||
2200 (doc->dict == NULL) ||
2201 (!xmlDictOwns(doc->dict, name)))
2202 xmlFree(name);
2203 return(NULL);
2204 }
2205
2206 return(cur);
2207}
2208
2209#ifdef LIBXML_TREE_ENABLED
2210/**

Callers 3

xmlSAX2StartElementFunction · 0.85
xmlSAX2StartElementNsFunction · 0.85
xmlNewNodeEatNameFunction · 0.85

Calls 2

xmlNewElemFunction · 0.85
xmlDictOwnsFunction · 0.85

Tested by

no test coverage detected