diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-11-01 17:04:58 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-11-01 17:04:58 +0000 |
commit | 254b12607d427687ae5c1bd75fabaf2ca530b65e (patch) | |
tree | 93bb0089af082c4322d3599c39352c7ad7ad366c /tree.c | |
parent | 375bf669d17d8e1ebe979777f6dd97ba4a27ee80 (diff) | |
download | libxml2-254b12607d427687ae5c1bd75fabaf2ca530b65e.tar.gz |
second BeOS patch from Marcin 'Shard' Konicki Daniel
* tree.c nanohttp.c threads.c: second BeOS patch from
Marcin 'Shard' Konicki
Daniel
Diffstat (limited to 'tree.c')
-rw-r--r-- | tree.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -2375,10 +2375,22 @@ xmlNewTextChild(xmlNodePtr parent, xmlNsPtr ns, /* * Allocate a new node */ - if (ns == NULL) - cur = xmlNewDocRawNode(parent->doc, parent->ns, name, content); - else - cur = xmlNewDocRawNode(parent->doc, ns, name, content); + if (parent->type == XML_ELEMENT_NODE) { + if (ns == NULL) + cur = xmlNewDocRawNode(parent->doc, parent->ns, name, content); + else + cur = xmlNewDocRawNode(parent->doc, ns, name, content); + } else if ((parent->type == XML_DOCUMENT_NODE) || + (parent->type == XML_HTML_DOCUMENT_NODE)) { + if (ns == NULL) + cur = xmlNewDocRawNode((xmlDocPtr) parent, NULL, name, content); + else + cur = xmlNewDocRawNode((xmlDocPtr) parent, ns, name, content); + } else if (parent->type == XML_DOCUMENT_FRAG_NODE) { + cur = xmlNewDocRawNode( parent->doc, ns, name, content); + } else { + return(NULL); + } if (cur == NULL) return(NULL); /* |