diff options
author | Frederic Peters <fpeters@entrouvert.com> | 2004-12-20 17:26:13 +0000 |
---|---|---|
committer | Frederic Peters <fpeters@entrouvert.com> | 2004-12-20 17:26:13 +0000 |
commit | 723a4ee54fe3101d803c861e69a513d82b223d1a (patch) | |
tree | 77a19b6d856c9b480bd2fe0967b786e0d01103df /lasso/xml | |
parent | 45cffc9121c5dfaa4f695995a879dd6ce80d53d9 (diff) | |
download | lasso-723a4ee54fe3101d803c861e69a513d82b223d1a.tar.gz lasso-723a4ee54fe3101d803c861e69a513d82b223d1a.tar.xz lasso-723a4ee54fe3101d803c861e69a513d82b223d1a.zip |
correctly sets namespace on Query and QueryResponse Personal Profile nodes.
Diffstat (limited to 'lasso/xml')
-rw-r--r-- | lasso/xml/dst_modify.c | 16 | ||||
-rw-r--r-- | lasso/xml/dst_modify_response.c | 16 | ||||
-rw-r--r-- | lasso/xml/dst_query.c | 16 | ||||
-rw-r--r-- | lasso/xml/dst_query_response.c | 10 |
4 files changed, 20 insertions, 38 deletions
diff --git a/lasso/xml/dst_modify.c b/lasso/xml/dst_modify.c index 6681198c..cf0428dd 100644 --- a/lasso/xml/dst_modify.c +++ b/lasso/xml/dst_modify.c @@ -77,17 +77,12 @@ static LassoNodeClass *parent_class = NULL; static void insure_namespace(xmlNode *xmlnode, xmlNs *ns) { - /* insure children are kept in same namespace */ - xmlNode *t; + xmlNode *t = xmlnode->children; - t = xmlnode->children; + xmlSetNs(xmlnode, ns); while (t) { - if (t->type != XML_ELEMENT_NODE) { - t = t->next; - continue; - } - xmlSetNs(xmlnode, ns); - insure_namespace(t, ns); + if (t->type == XML_ELEMENT_NODE && t->ns == NULL) + insure_namespace(t, ns); t = t->next; } } @@ -100,8 +95,7 @@ get_xmlNode(LassoNode *node, gboolean lasso_dump) xmlnode = parent_class->get_xmlNode(node, lasso_dump); ns = xmlNewNs(xmlnode, LASSO_DST_MODIFY(node)->hrefServiceType, - LASSO_DST_MODIFY(node)->prefixServiceType); - xmlSetNs(xmlnode, ns); + LASSO_DST_MODIFY(node)->prefixServiceType); insure_namespace(xmlnode, ns); return xmlnode; diff --git a/lasso/xml/dst_modify_response.c b/lasso/xml/dst_modify_response.c index 559251e1..853c74dc 100644 --- a/lasso/xml/dst_modify_response.c +++ b/lasso/xml/dst_modify_response.c @@ -58,17 +58,12 @@ static LassoNodeClass *parent_class = NULL; static void insure_namespace(xmlNode *xmlnode, xmlNs *ns) { - /* insure children are kept in same namespace */ - xmlNode *t; + xmlNode *t = xmlnode->children; - t = xmlnode->children; + xmlSetNs(xmlnode, ns); while (t) { - if (t->type != XML_ELEMENT_NODE) { - t = t->next; - continue; - } - xmlSetNs(xmlnode, ns); - insure_namespace(t, ns); + if (t->type == XML_ELEMENT_NODE && t->ns == NULL) + insure_namespace(t, ns); t = t->next; } } @@ -81,8 +76,7 @@ get_xmlNode(LassoNode *node, gboolean lasso_dump) xmlnode = parent_class->get_xmlNode(node, lasso_dump); ns = xmlNewNs(xmlnode, LASSO_DST_MODIFY_RESPONSE(node)->hrefServiceType, - LASSO_DST_MODIFY_RESPONSE(node)->prefixServiceType); - xmlSetNs(xmlnode, ns); + LASSO_DST_MODIFY_RESPONSE(node)->prefixServiceType); insure_namespace(xmlnode, ns); return xmlnode; diff --git a/lasso/xml/dst_query.c b/lasso/xml/dst_query.c index 2b1ba141..6a80388f 100644 --- a/lasso/xml/dst_query.c +++ b/lasso/xml/dst_query.c @@ -67,17 +67,12 @@ static LassoNodeClass *parent_class = NULL; static void insure_namespace(xmlNode *xmlnode, xmlNs *ns) { - /* insure children are kept in same namespace */ - xmlNode *t; + xmlNode *t = xmlnode->children; - t = xmlnode->children; + xmlSetNs(xmlnode, ns); while (t) { - if (t->type != XML_ELEMENT_NODE) { - t = t->next; - continue; - } - xmlSetNs(xmlnode, ns); - insure_namespace(t, ns); + if (t->type == XML_ELEMENT_NODE && t->ns == NULL) + insure_namespace(t, ns); t = t->next; } } @@ -90,8 +85,7 @@ get_xmlNode(LassoNode *node, gboolean lasso_dump) xmlnode = parent_class->get_xmlNode(node, lasso_dump); ns = xmlNewNs(xmlnode, LASSO_DST_QUERY(node)->hrefServiceType, - LASSO_DST_QUERY(node)->prefixServiceType); - xmlSetNs(xmlnode, ns); + LASSO_DST_QUERY(node)->prefixServiceType); insure_namespace(xmlnode, ns); return xmlnode; diff --git a/lasso/xml/dst_query_response.c b/lasso/xml/dst_query_response.c index 12e74295..8ee04f8c 100644 --- a/lasso/xml/dst_query_response.c +++ b/lasso/xml/dst_query_response.c @@ -71,16 +71,17 @@ static LassoNodeClass *parent_class = NULL; static void insure_namespace(xmlNode *xmlnode, xmlNs *ns) { - /* insure children are kept in same namespace */ xmlNode *t; t = xmlnode->children; + xmlSetNs(xmlnode, ns); while (t) { if (t->type != XML_ELEMENT_NODE) { t = t->next; continue; } - xmlSetNs(xmlnode, ns); + if (t->ns == NULL) + xmlSetNs(xmlnode, ns); insure_namespace(t, ns); t = t->next; } @@ -93,9 +94,8 @@ get_xmlNode(LassoNode *node, gboolean lasso_dump) xmlNs *ns; xmlnode = parent_class->get_xmlNode(node, lasso_dump); - ns = xmlNewNs(xmlnode, LASSO_DST_QUERY_RESPONSE(node)->hrefServiceType, - LASSO_DST_QUERY_RESPONSE(node)->prefixServiceType); - xmlSetNs(xmlnode, ns); + ns = xmlNewNs(NULL, LASSO_DST_QUERY_RESPONSE(node)->hrefServiceType, + LASSO_DST_QUERY_RESPONSE(node)->prefixServiceType); insure_namespace(xmlnode, ns); return xmlnode; |