summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-12-06 13:16:43 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-12-06 13:16:43 +0000
commit7b4fd972a68225d6fbcddab0ea69ad1aa8a49e2f (patch)
tree886bbc094c06718f86e6eb820dcff2d7be83daed
parenta49d4809e03a202eebad9f1660878d2b6f8b053d (diff)
downloadlasso-7b4fd972a68225d6fbcddab0ea69ad1aa8a49e2f.tar.gz
lasso-7b4fd972a68225d6fbcddab0ea69ad1aa8a49e2f.tar.xz
lasso-7b4fd972a68225d6fbcddab0ea69ad1aa8a49e2f.zip
dealt with namespaces in a manner compatibler with libxml2 2.6.11 and 2.6.16
-rw-r--r--lasso/xml/xml.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
index 21e11e0f..844bcb39 100644
--- a/lasso/xml/xml.c
+++ b/lasso/xml/xml.c
@@ -550,22 +550,29 @@ lasso_node_impl_get_xmlNode(LassoNode *node)
{
LassoNodeClass *class = LASSO_NODE_GET_CLASS(node);
xmlNode *xmlnode;
- xmlNs *firstns = NULL;
+ xmlNs *ns;
+ GList *list_ns = NULL, *t;
if (class->node_data == NULL)
return NULL;
xmlnode = xmlNewNode(NULL, class->node_data->node_name);
while (class && LASSO_IS_NODE_CLASS(class) && class->node_data) {
- if (firstns == NULL) firstns = class->node_data->ns;
if (class->node_data->ns)
- xmlSetNs(xmlnode, class->node_data->ns);
+ list_ns = g_list_append(list_ns, class->node_data->ns);
lasso_node_build_xmlNode_from_snippets(node, xmlnode, class->node_data->snippets);
class = g_type_class_peek_parent(class);
}
- class = LASSO_NODE_GET_CLASS(node);
- xmlSetNs(xmlnode, firstns);
+ t = g_list_first(list_ns);
+ while (t) {
+ ns = t->data;
+ xmlNewNs(xmlnode, ns->href, ns->prefix);
+ t = g_list_next(t);
+ }
+
+ fprintf(stderr, "ns: %s\n", xmlnode->nsDef->prefix);
+ xmlSetNs(xmlnode, xmlnode->nsDef);
xmlReconciliateNs(NULL, xmlnode);