summaryrefslogtreecommitdiffstats
path: root/lasso/xml
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-12-20 17:26:13 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-12-20 17:26:13 +0000
commit723a4ee54fe3101d803c861e69a513d82b223d1a (patch)
tree77a19b6d856c9b480bd2fe0967b786e0d01103df /lasso/xml
parent45cffc9121c5dfaa4f695995a879dd6ce80d53d9 (diff)
downloadlasso-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.c16
-rw-r--r--lasso/xml/dst_modify_response.c16
-rw-r--r--lasso/xml/dst_query.c16
-rw-r--r--lasso/xml/dst_query_response.c10
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;