From dec18ebdc15c7b3d3a7337bc9c021998c3b2e0db Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Tue, 16 May 2006 08:10:28 +0000 Subject: support for SNIPPET_LIST_XMLNODES (very old patch) --- lasso/xml/saml_attribute_value.c | 2 +- lasso/xml/xml.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lasso/xml/saml_attribute_value.c b/lasso/xml/saml_attribute_value.c index c7a61e32..2d73affc 100644 --- a/lasso/xml/saml_attribute_value.c +++ b/lasso/xml/saml_attribute_value.c @@ -35,7 +35,7 @@ /*****************************************************************************/ static struct XmlSnippet schema_snippets[] = { - { "", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoSamlAttributeValue, any) }, + { "", SNIPPET_LIST_XMLNODES, G_STRUCT_OFFSET(LassoSamlAttributeValue, any) }, { NULL, 0, 0 } }; diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index f4d94df8..98c2ec3d 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -370,6 +370,21 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) while (class && LASSO_IS_NODE_CLASS(class) && class->node_data) { for (t = xmlnode->children; t; t = t->next) { + if (t->type == XML_TEXT_NODE) { + for (snippet = class->node_data->snippets; + snippet && snippet->name; snippet++) { + type = snippet->type & 0xff; + value = G_STRUCT_MEMBER_P(node, snippet->offset); + + if (type != SNIPPET_LIST_XMLNODES) + continue; + + GList **location = value; + *location = g_list_append(*location, xmlCopyNode(t, 1)); + } + continue; + } + if (t->type != XML_ELEMENT_NODE) continue; -- cgit