summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-09-23 00:51:36 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-09-23 00:51:36 +0000
commit34f4d422a253a529972918ac19b5551adab87d8f (patch)
tree2d44adce9361512506b7dc2c1ec9fc7749beb3b9
parentbe0d8b580dd64fce2398d911adcbac9665369a7b (diff)
downloadlibdom-34f4d422a253a529972918ac19b5551adab87d8f.tar.gz
libdom-34f4d422a253a529972918ac19b5551adab87d8f.tar.bz2
Fix dom_element_set_attribute() to use dom_attr_set_value() to replace the value of an existing attribute -- attribute values are stored as a tree of child nodes, not as a string attached to the nodeValue pointer.
svn path=/trunk/dom/; revision=3580
-rw-r--r--src/core/element.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/element.c b/src/core/element.c
index 16c6932..0d23347 100644
--- a/src/core/element.c
+++ b/src/core/element.c
@@ -253,12 +253,11 @@ dom_exception dom_element_set_attribute(struct dom_element *element,
if (a != NULL) {
/* Found an existing attribute, so replace its value */
- if (a->value != NULL)
- dom_string_unref(a->value);
+ dom_exception err;
- if (value != NULL)
- dom_string_ref(value);
- a->value = value;
+ err = dom_attr_set_value((struct dom_attr *) a, value);
+ if (err != DOM_NO_ERR)
+ return err;
} else {
/* No existing attribute, so create one */
dom_exception err;