* 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. */
| 2222 | * invalid or a memory allocation failed. |
| 2223 | */ |
| 2224 | xmlNodePtr |
| 2225 | xmlNewDocRawNode(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: |
no test coverage detected