[xml] Difference btw. xmlNewDocNode and xmlNewNode
- From: Trappel Martin <martin trappel ksengineers at>
- To: xml gnome org
- Subject: [xml] Difference btw. xmlNewDocNode and xmlNewNode
- Date: Fri, 30 Mar 2007 12:52:11 +0200
Greetings!
I'm really a bit confused about xmlNewDocNode() vs. xmlDocNode() ...
Can anyone explain to me what's the difference in using these two (or point
me to where that kindo of basics would be explained)?
xmlNodePtr xmlNewNode (xmlNsPtr ns, const xmlChar * name)
Vs.
xmlNodePtr xmlNewDocNode (xmlDocPtr doc, xmlNsPtr ns, const xmlChar * name,
const xmlChar * content)
{
doc = xmlNewDoc(BAD_CAST XML_DEFAULT_VERSION);
root_element = xmlNewDocNode(doc, NULL, BAD_CAST "EXAMPLE", NULL);
xmlDocSetRootElement(doc, root_element);
...
xmlFreeDoc(doc);
}
Vs.
{
doc = xmlNewDoc(BAD_CAST XML_DEFAULT_VERSION);
root_element = xmlNewNode(NULL, BAD_CAST "EXAMPLE");
xmlDocSetRootElement(doc, root_element);
...
xmlFreeDoc(doc);
}
-> ?
Thank you!
best regards / mit freundlichen Grüßen,
Martin Trappel
-------------------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]