diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2005-01-27 09:58:31 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2005-01-27 09:58:31 +0000 |
| commit | 640892cc83522ca1fe77a5ac977e4e162fb956f6 (patch) | |
| tree | ad96d6b614f332fef2f2e703b8f5c9260cb1b840 | |
| parent | 045505afc2ea50edb4714037640df59308b5ea05 (diff) | |
| download | lasso-640892cc83522ca1fe77a5ac977e4e162fb956f6.tar.gz lasso-640892cc83522ca1fe77a5ac977e4e162fb956f6.tar.xz lasso-640892cc83522ca1fe77a5ac977e4e162fb956f6.zip | |
correctly deals with multiple elements for the same query part
| -rw-r--r-- | lasso/extract_symbols.py | 9 | ||||
| -rw-r--r-- | lasso/xml/xml.c | 24 |
2 files changed, 32 insertions, 1 deletions
diff --git a/lasso/extract_symbols.py b/lasso/extract_symbols.py index 05c4df33..7db9c3b2 100644 --- a/lasso/extract_symbols.py +++ b/lasso/extract_symbols.py @@ -15,6 +15,13 @@ symbols = [] for header_file in glob.glob('%s/*/*.h' % srcdir) + glob.glob('%s/*.h' % srcdir): symbols.extend(regex.findall(file(header_file).read().replace('\\\n', ''))) +wsf = ['lasso_disco', 'lasso_dst', 'lasso_is', 'lasso_profile_service', + 'lasso_discovery', 'lasso_wsf', 'lasso_interaction', 'lasso_utility' ] + for s in symbols: - print s + for t in wsf: + if s.startswith(t): + break + else: + print s diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index a36c7d63..b83bea95 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -1167,6 +1167,21 @@ get_value_by_path(LassoNode *node, char *path, struct XmlSnippet *xml_snippet) return NULL; } return g_string_free(result, FALSE); + } else if (snippet->type == SNIPPET_LIST_CONTENT) { + /* not clear in spec; concat values with spaces */ + GList *value = G_STRUCT_MEMBER(GList*, value_node, snippet->offset); + GString *result = g_string_new(""); + while (value) { + result = g_string_append(result, (char*)value->data); + if (value->next) + result = g_string_append(result, " "); + value = value->next; + } + if (result->len == 0) { + g_string_free(result, TRUE); + return NULL; + } + return g_string_free(result, FALSE); } else { char *value = G_STRUCT_MEMBER(char*, value_node, snippet->offset); if (value == NULL) return NULL; @@ -1200,6 +1215,15 @@ set_value_at_path(LassoNode *node, char *path, char *query_value) g_assert_not_reached(); } LASSO_NODE_GET_CLASS(v)->init_from_query(v, &query_value); + } else if (snippet->type == SNIPPET_LIST_CONTENT) { + char **elems = g_strsplit(query_value, " ", 0); + char *p; + GList *l = NULL; + for (p = elems[0]; p; p++) { + l = g_list_append(l, p); + } + g_strfreev(elems); + (*(GList**)value) = l; } else { (*(char**)value) = g_strdup(query_value); } |
