diff options
| author | Damien Laniel <dlaniel@entrouvert.com> | 2007-06-06 09:19:12 +0000 |
|---|---|---|
| committer | Damien Laniel <dlaniel@entrouvert.com> | 2007-06-06 09:19:12 +0000 |
| commit | c246e3779d34bf8637de96c14b5baa3be6e3234c (patch) | |
| tree | 4063d11902b7a0172bcf8760c28b4b05e48413f0 | |
| parent | 2371c8003d3ab22596b13b0ad4ebe6d21386a9ed (diff) | |
changed QueryResponse items data from string to xmlNode
| -rw-r--r-- | lasso/id-wsf-2.0/data_service.c | 29 | ||||
| -rw-r--r-- | lasso/xml/id-wsf-2.0/dstref_item_data.c | 24 | ||||
| -rw-r--r-- | lasso/xml/id-wsf-2.0/dstref_item_data.h | 3 |
3 files changed, 6 insertions, 50 deletions
diff --git a/lasso/id-wsf-2.0/data_service.c b/lasso/id-wsf-2.0/data_service.c index b64c43af..205b18ea 100644 --- a/lasso/id-wsf-2.0/data_service.c +++ b/lasso/id-wsf-2.0/data_service.c @@ -145,33 +145,6 @@ lasso_idwsf2_data_service_process_query_msg(LassoIdWsf2DataService *service, con return res; } -/* XXX: Taken from swig/Lasso.i . Should probably be moved to xml.c */ -static gchar* get_xml_string(xmlNode *xmlnode) -{ - xmlOutputBufferPtr buf; - gchar *xmlString; - - if (xmlnode == NULL) { - return NULL; - } - - buf = xmlAllocOutputBuffer(NULL); - if (buf == NULL) { - xmlString = NULL; - } else { - xmlNodeDumpOutput(buf, NULL, xmlnode, 0, 1, NULL); - xmlOutputBufferFlush(buf); - if (buf->conv == NULL) { - xmlString = g_strdup((gchar*)buf->buffer->content); - } else { - xmlString = g_strdup((gchar*)buf->conv->content); - } - xmlOutputBufferClose(buf); - } - xmlFreeNode(xmlnode); - return xmlString; -} - gint lasso_idwsf2_data_service_build_query_response_msg(LassoIdWsf2DataService *service) { @@ -217,7 +190,7 @@ lasso_idwsf2_data_service_build_query_response_msg(LassoIdWsf2DataService *servi /* XXX: assuming there is only one matching node */ data = lasso_idwsf2_dstref_data_new(); data_item = LASSO_IDWSF2_DSTREF_ITEM_DATA(data); - data_item->content = get_xml_string(node); + data_item->any = g_list_append(data_item->any, xmlCopyNode(node, 1)); if (item_result_query_base->itemID != NULL) { data_item->itemIDRef = g_strdup(item_result_query_base->itemID); } diff --git a/lasso/xml/id-wsf-2.0/dstref_item_data.c b/lasso/xml/id-wsf-2.0/dstref_item_data.c index ea18e898..2f481a75 100644 --- a/lasso/xml/id-wsf-2.0/dstref_item_data.c +++ b/lasso/xml/id-wsf-2.0/dstref_item_data.c @@ -42,8 +42,8 @@ static struct XmlSnippet schema_snippets[] = { - { "content", SNIPPET_TEXT_CHILD, - G_STRUCT_OFFSET(LassoIdWsf2DstRefItemData, content) }, + { "any", SNIPPET_LIST_XMLNODES, + G_STRUCT_OFFSET(LassoIdWsf2DstRefItemData, any) }, { "itemIDRef", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIdWsf2DstRefItemData, itemIDRef) }, { "notSorted", SNIPPET_ATTRIBUTE, @@ -63,7 +63,7 @@ static LassoNodeClass *parent_class = NULL; static void instance_init(LassoIdWsf2DstRefItemData *node) { - node->content = NULL; + node->any = NULL; node->itemIDRef = NULL; node->notSorted = NULL; node->changeFormat = NULL; @@ -118,21 +118,3 @@ lasso_idwsf2_dstref_item_data_new() return g_object_new(LASSO_TYPE_IDWSF2_DSTREF_ITEM_DATA, NULL); } - -/** - * lasso_idwsf2_dstref_item_data_new_with_string: - * @content: - * - * Creates a new #LassoIdWsf2DstRefItemData object and initializes it - * with @content. - * - * Return value: a newly created #LassoIdWsf2DstRefItemData object - **/ -LassoNode* -lasso_idwsf2_dstref_item_data_new_with_string(char *content) -{ - LassoIdWsf2DstRefItemData *object; - object = g_object_new(LASSO_TYPE_IDWSF2_DSTREF_ITEM_DATA, NULL); - object->content = g_strdup(content); - return LASSO_NODE(object); -} diff --git a/lasso/xml/id-wsf-2.0/dstref_item_data.h b/lasso/xml/id-wsf-2.0/dstref_item_data.h index 56038ba8..c16c0f8b 100644 --- a/lasso/xml/id-wsf-2.0/dstref_item_data.h +++ b/lasso/xml/id-wsf-2.0/dstref_item_data.h @@ -61,7 +61,8 @@ struct _LassoIdWsf2DstRefItemData { /*< public >*/ /* elements */ - char *content; + GList *any; /* list of xmlNodes */ + /* attributes */ char *itemIDRef; char *notSorted; |
