diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2007-09-27 23:03:13 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2007-09-27 23:03:13 +0000 |
commit | 7b83a0bb1cd4604ab6a55705c4b1c40c769090a6 (patch) | |
tree | e8740ad003d8f601a8f9d665e587233ec58c12e9 /src/core/node.c | |
parent | 024e202af7efd730c0b6de46901d2cb274556b4f (diff) | |
download | libdom-7b83a0bb1cd4604ab6a55705c4b1c40c769090a6.tar.gz libdom-7b83a0bb1cd4604ab6a55705c4b1c40c769090a6.tar.bz2 |
Modify dom_node_initialise() API to permit specification of namespace URI and prefix.
Fix up everything else to cope.
svn path=/trunk/dom/; revision=3599
Diffstat (limited to 'src/core/node.c')
-rw-r--r-- | src/core/node.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/core/node.c b/src/core/node.c index 2a90df8..8eff2ec 100644 --- a/src/core/node.c +++ b/src/core/node.c @@ -130,18 +130,22 @@ void dom_node_destroy(struct dom_node *node) /** * Initialise a DOM node * - * \param node The node to initialise - * \param doc The document which owns the node - * \param type The node type required - * \param name The node name, or NULL - * \param value The node value, or NULL + * \param node The node to initialise + * \param doc The document which owns the node + * \param type The node type required + * \param name The node (local) name, or NULL + * \param value The node value, or NULL + * \param namespace Namespace URI to use for node, or NULL + * \param prefix Namespace prefix to use for node, or NULL * \return DOM_NO_ERR on success. * - * ::name and ::value will have their reference counts increased. + * ::name, ::value, ::namespace, and ::prefix will have their reference + * counts increased. */ dom_exception dom_node_initialise(struct dom_node *node, struct dom_document *doc, dom_node_type type, - struct dom_string *name, struct dom_string *value) + struct dom_string *name, struct dom_string *value, + struct dom_string *namespace, struct dom_string *prefix) { if (name != NULL) dom_string_ref(name); @@ -179,9 +183,15 @@ dom_exception dom_node_initialise(struct dom_node *node, */ node->owner = doc; - /** \todo Namespace handling */ - node->namespace = NULL; - node->prefix = NULL; + if (namespace != NULL) { + dom_string_ref(namespace); + } + node->namespace = namespace; + + if (prefix != NULL) { + dom_string_ref(prefix); + } + node->prefix = prefix; node->user_data = NULL; |