summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2008-08-01 14:11:10 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2008-08-01 14:11:10 +0000
commit2285367f6befa9849f205f27af8f2b90920201f2 (patch)
treee56002d8ed4da353d51c969d4f1b2b7745468f1f
parent72e61fb41712657ace0f2b8980eb7f332d37259f (diff)
* lasso/xml/soap_body.h: change name of variable id to Id
* lasso/xml/soap_body.c: change attribute id to Id and fix its namespace (wssu) in overloaded get_xmlNode
-rw-r--r--lasso/xml/soap_body.c26
-rw-r--r--lasso/xml/soap_body.h2
2 files changed, 25 insertions, 3 deletions
diff --git a/lasso/xml/soap_body.c b/lasso/xml/soap_body.c
index bf60bc7e..419968ff 100644
--- a/lasso/xml/soap_body.c
+++ b/lasso/xml/soap_body.c
@@ -23,6 +23,7 @@
*/
#include <lasso/xml/soap_body.h>
+#include <lasso/xml/private.h>
/**
* SECTION:soap_body
@@ -54,7 +55,6 @@
static struct XmlSnippet schema_snippets[] = {
{ "", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoSoapBody, any) },
- { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBody, id) },
{ NULL, 0, 0}
};
@@ -62,24 +62,46 @@ static struct XmlSnippet schema_snippets[] = {
/* instance and class init functions */
/*****************************************************************************/
+static xmlNode* get_xmlNode(LassoNode *node, gboolean lasso_dump);
+
static void
instance_init(LassoSoapBody *node)
{
node->any = NULL;
- node->id = NULL;
+ node->Id = NULL;
}
+static LassoNodeClass *parent_class = NULL;
+
static void
class_init(LassoSoapBodyClass *klass)
{
LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
+ parent_class = g_type_class_peek_parent(nclass);
nclass->node_data = g_new0(LassoNodeClassData, 1);
+ nclass->get_xmlNode = get_xmlNode;
lasso_node_class_set_nodename(nclass, "Body");
lasso_node_class_set_ns(nclass, LASSO_SOAP_ENV_HREF, LASSO_SOAP_ENV_PREFIX);
lasso_node_class_add_snippets(nclass, schema_snippets);
}
+static xmlNode*
+get_xmlNode(LassoNode *node, gboolean lasso_dump) {
+ xmlNodePtr ret;
+
+ /* Fix namespace of Id */
+ ret = parent_class->get_xmlNode(node, lasso_dump);
+
+ {
+ xmlNsPtr ns;
+ ns = xmlNewNs(ret, (xmlChar*)LASSO_WSUTIL1_HREF, (xmlChar*)LASSO_WSUTIL1_PREFIX);
+ xmlNewNsProp(ret, ns, (xmlChar*)"Id", (xmlChar*)LASSO_SOAP_BODY(node)->Id);
+ }
+
+ return ret;
+}
+
GType
lasso_soap_body_get_type()
{
diff --git a/lasso/xml/soap_body.h b/lasso/xml/soap_body.h
index 1a8ea31d..2dc4f6ee 100644
--- a/lasso/xml/soap_body.h
+++ b/lasso/xml/soap_body.h
@@ -49,7 +49,7 @@ struct _LassoSoapBody {
LassoNode parent;
GList *any;
- gchar *id;
+ gchar *Id;
/* TODO : supports of any attributes */
};