mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-23 17:33:50 +03:00
Make sure that new object carry the proper type value, Daniel.
This commit is contained in:
parent
27fb07571f
commit
33942846fc
@ -1,3 +1,8 @@
|
||||
Sun Oct 18 15:08:19 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||
|
||||
* tree.c : make sure that the type id is properly set-up when
|
||||
a new object is allocated, needed for DOM.
|
||||
|
||||
Sat Oct 17 02:43:21 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||
|
||||
* tree.h, tree.c: Ok, the main objects in the tree will be native
|
||||
|
10
tree.c
10
tree.c
@ -268,6 +268,7 @@ xmlDocPtr xmlNewDoc(const CHAR *version) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
cur->type = XML_DOCUMENT_NODE;
|
||||
cur->version = xmlStrdup(version);
|
||||
cur->name = NULL;
|
||||
cur->root = NULL;
|
||||
@ -323,6 +324,7 @@ xmlAttrPtr xmlNewProp(xmlNodePtr node, const CHAR *name, const CHAR *value) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
cur->type = XML_ATTRIBUTE_NODE;
|
||||
cur->node = node;
|
||||
cur->name = xmlStrdup(name);
|
||||
if (value != NULL)
|
||||
@ -404,6 +406,7 @@ xmlNodePtr xmlNewNode(xmlNsPtr ns, const CHAR *name, CHAR *content) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
cur->type = XML_ELEMENT_NODE;
|
||||
cur->doc = NULL;
|
||||
cur->parent = NULL;
|
||||
cur->next = NULL;
|
||||
@ -450,6 +453,7 @@ xmlNodePtr xmlNewText(const CHAR *content) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
cur->type = XML_TEXT_NODE;
|
||||
cur->doc = NULL;
|
||||
cur->parent = NULL;
|
||||
cur->next = NULL;
|
||||
@ -490,6 +494,7 @@ xmlNodePtr xmlNewTextLen(const CHAR *content, int len) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
cur->type = XML_TEXT_NODE;
|
||||
cur->doc = NULL;
|
||||
cur->parent = NULL;
|
||||
cur->prev = NULL;
|
||||
@ -530,6 +535,7 @@ xmlNodePtr xmlNewComment(CHAR *content) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
cur->type = XML_COMMENT_NODE;
|
||||
cur->doc = NULL;
|
||||
cur->parent = NULL;
|
||||
cur->prev = NULL;
|
||||
@ -584,6 +590,10 @@ xmlNodePtr xmlNewChild(xmlNodePtr parent, xmlNsPtr ns,
|
||||
/*
|
||||
* add the new element at the end of the childs list.
|
||||
*/
|
||||
if (content == NULL)
|
||||
cur->type = XML_ELEMENT_NODE;
|
||||
else
|
||||
cur->type = XML_TEXT_NODE;
|
||||
cur->parent = parent;
|
||||
cur->doc = parent->doc;
|
||||
if (parent->childs == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user