diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2005-01-19 10:10:56 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2005-01-19 10:10:56 +0000 |
| commit | 979dda50ed08dd29b90b0b40fe4f9e9aafd59ddb (patch) | |
| tree | d95fe00120610db8ec405cae73c8cff143f030a5 | |
| parent | 4388b8855d000762f1b418a0d773c81dd9681638 (diff) | |
| download | lasso-979dda50ed08dd29b90b0b40fe4f9e9aafd59ddb.tar.gz lasso-979dda50ed08dd29b90b0b40fe4f9e9aafd59ddb.tar.xz lasso-979dda50ed08dd29b90b0b40fe4f9e9aafd59ddb.zip | |
added SNIPPET_LIST_XMLNODES support (mostly the same thing as SNIPPET_EXTENSION
for the moment)
| -rw-r--r-- | docs/reference/snippet-types.rst | 9 | ||||
| -rw-r--r-- | lasso/xml/private.h | 1 | ||||
| -rw-r--r-- | lasso/xml/xml.c | 7 |
3 files changed, 16 insertions, 1 deletions
diff --git a/docs/reference/snippet-types.rst b/docs/reference/snippet-types.rst index 75a802b5..03b351dc 100644 --- a/docs/reference/snippet-types.rst +++ b/docs/reference/snippet-types.rst @@ -60,6 +60,15 @@ SNIPPET_LIST_CONTENT <Name>Value-n</Name> </Parent> +SNIPPET_LIST_XMLNODES + + <Parent> + <Value-1/> + <Value-2/> + <Value-3/> + </Parent> + + SNIPPET_EXTENSION (for <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/>) diff --git a/lasso/xml/private.h b/lasso/xml/private.h index 13ff37b7..b93fdc13 100644 --- a/lasso/xml/private.h +++ b/lasso/xml/private.h @@ -44,6 +44,7 @@ typedef enum { SNIPPET_LIST_CONTENT, SNIPPET_EXTENSION, SNIPPET_SIGNATURE, + SNIPPET_LIST_XMLNODES, /* transformers for content transformation */ SNIPPET_STRING = 1 << 0, /* default, can be omitted */ diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index c91f3b0c..998bb0f5 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -336,7 +336,8 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) GList **location = value; xmlChar *s = xmlNodeGetContent(t); *location = g_list_append(*location, s); - } else if (type == SNIPPET_EXTENSION) { + } else if (type == SNIPPET_EXTENSION || + type == SNIPPET_LIST_XMLNODES) { GList **location = value; *location = g_list_append(*location, xmlCopyNode(t, 1)); } @@ -485,8 +486,11 @@ lasso_node_dispose(GObject *object) case SNIPPET_EXTENSION: case SNIPPET_LIST_NODES: case SNIPPET_LIST_CONTENT: + case SNIPPET_LIST_XMLNODES: elem = (GList*)(*value); while (elem) { + if (type == SNIPPET_LIST_XMLNODES) + xmlFreeNode(elem->data); if (type == SNIPPET_EXTENSION) xmlFreeNode(elem->data); if (type == SNIPPET_LIST_NODES) @@ -919,6 +923,7 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, xmlNode *xmlnode, elem = g_list_next(elem); } break; + case SNIPPET_LIST_XMLNODES: case SNIPPET_EXTENSION: elem = (GList *)value; while (elem) { |
