diff options
author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2011-03-07 16:25:17 +0100 |
---|---|---|
committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2011-03-07 16:25:17 +0100 |
commit | 78c9a9382afe9b9edf68f78041b021a3f2611b7a (patch) | |
tree | 960a21523f754d84785317867e8a4c67a410d665 /lasso/xml | |
parent | 7ef67c8d7e0ded8cbf9abb274b4ef9655fda5731 (diff) | |
download | lasso-78c9a9382afe9b9edf68f78041b021a3f2611b7a.tar.gz lasso-78c9a9382afe9b9edf68f78041b021a3f2611b7a.tar.xz lasso-78c9a9382afe9b9edf68f78041b021a3f2611b7a.zip |
[xml] fix lasso_node_get_xmlnode_for_any_type
xmlCopyPropList does not copy the property list into the target it just
copy it with respect to the target (mainly for namespace references).
This patch adds the real copy into the target node.
Diffstat (limited to 'lasso/xml')
-rw-r--r-- | lasso/xml/xml.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index f4895316..55f32457 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -3253,7 +3253,16 @@ lasso_node_get_xmlnode_for_any_type(LassoNode *node, xmlNode *cur) if (cur) { if (original_xmlnode) { xmlNode *children = xmlCopyNodeList(original_xmlnode->children); - xmlCopyPropList(cur, original_xmlnode->properties); + xmlAttr *attrs = xmlCopyPropList(cur, original_xmlnode->properties); + if (cur->properties == NULL) { + cur->properties = attrs; + } else { + xmlAttr *it = cur->properties; + while (it->next) { + it = it->next; + } + it->next = attrs; + } xmlAddChildList(cur, children); return cur; } else { |