Added a Fragment function for Raph (DOM) Daniel.

This commit is contained in:
Daniel Veillard 2000-01-09 21:08:56 +00:00
parent f84f71f473
commit 2eac503994
5 changed files with 46 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Sun Jan 9 23:03:20 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* tree.[ch] : added xmlNewDocFragment() for DOM
* testHTML.c: uninitialized variable.
Wed Jan 5 17:29:17 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* doc/* : rebuild the docs

View File

@ -426,6 +426,7 @@ xmlNodePtr xmlNewReference (xmlDocPtr doc,
xmlNodePtr xmlCopyNode (xmlNodePtr node,
int recursive);
xmlNodePtr xmlCopyNodeList (xmlNodePtr node);
xmlNodePtr xmlNewDocFragment (xmlDocPtr doc);
/*
* Navigating

View File

@ -584,7 +584,7 @@ void parseSAXFile(char *filename) {
}
void parseAndPrintFile(char *filename) {
htmlDocPtr doc, tmp;
htmlDocPtr doc = NULL, tmp;
/*
* build an HTML tree from a string;

38
tree.c
View File

@ -1152,6 +1152,44 @@ xmlNewDocRawNode(xmlDocPtr doc, xmlNsPtr ns,
return(cur);
}
/**
* xmlNewDocFragment:
* @doc: the document owning the fragment
*
* Creation of a new Fragment node.
* Returns a pointer to the new node object.
*/
xmlNodePtr
xmlNewDocFragment(xmlDocPtr doc) {
xmlNodePtr cur;
/*
* Allocate a new DocumentFragment node and fill the fields.
*/
cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
if (cur == NULL) {
fprintf(stderr, "xmlNewDocFragment : malloc failed\n");
return(NULL);
}
cur->type = XML_DOCUMENT_FRAG_NODE;
cur->doc = doc;
cur->parent = NULL;
cur->next = NULL;
cur->prev = NULL;
cur->childs = NULL;
cur->last = NULL;
cur->properties = NULL;
cur->name = NULL;
cur->ns = NULL;
cur->nsDef = NULL;
cur->content = NULL;
#ifndef XML_WITHOUT_CORBA
cur->_private = NULL;
cur->vepv = NULL;
#endif
return(cur);
}
/**
* xmlNewText:

1
tree.h
View File

@ -426,6 +426,7 @@ xmlNodePtr xmlNewReference (xmlDocPtr doc,
xmlNodePtr xmlCopyNode (xmlNodePtr node,
int recursive);
xmlNodePtr xmlCopyNodeList (xmlNodePtr node);
xmlNodePtr xmlNewDocFragment (xmlDocPtr doc);
/*
* Navigating