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

Function xmlNewDocRawNode

ThirdParty/libxml2/vtklibxml2/tree.c:2224–2247  ·  view source on GitHub ↗

* xmlNewDocRawNode: * @doc: the target document * @ns: namespace (optional) * @name: the node name * @content: raw text content (optional) * * Create an element node. * * If provided, @value should be a raw, unescaped string. * * Returns a pointer to the new node object or NULL if arguments are * invalid or a memory allocation failed. */

Source from the content-addressed store, hash-verified

2222 * invalid or a memory allocation failed.
2223 */
2224xmlNodePtr
2225xmlNewDocRawNode(xmlDocPtr doc, xmlNsPtr ns,
2226 const xmlChar *name, const xmlChar *content) {
2227 xmlNodePtr cur;
2228
2229 cur = xmlNewDocNode(doc, ns, name, NULL);
2230 if (cur != NULL) {
2231 cur->doc = doc;
2232 if (content != NULL) {
2233 xmlNodePtr text;
2234
2235 text = xmlNewDocText(doc, content);
2236 if (text == NULL) {
2237 xmlFreeNode(cur);
2238 return(NULL);
2239 }
2240
2241 cur->children = text;
2242 cur->last = text;
2243 text->parent = cur;
2244 }
2245 }
2246 return(cur);
2247}
2248
2249/**
2250 * xmlNewDocFragment:

Callers 1

xmlNewTextChildFunction · 0.85

Calls 3

xmlNewDocNodeFunction · 0.85
xmlNewDocTextFunction · 0.85
xmlFreeNodeFunction · 0.85

Tested by

no test coverage detected