summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/reference/snippet-types.rst4
-rw-r--r--lasso/xml/xml.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/docs/reference/snippet-types.rst b/docs/reference/snippet-types.rst
index 03b351dc..9390de74 100644
--- a/docs/reference/snippet-types.rst
+++ b/docs/reference/snippet-types.rst
@@ -51,6 +51,10 @@ SNIPPET_LIST_NODES
<Value-n/>
</Parent>
+[note: if there are no other nodes; it is possible to leave snippet name as
+ the empty string; nodes will then be constructed looking at their names and
+ namespaces (this is useful for xs:any)]
+
SNIPPET_LIST_CONTENT
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
index 566a0165..a36c7d63 100644
--- a/lasso/xml/xml.c
+++ b/lasso/xml/xml.c
@@ -331,7 +331,7 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode)
type = snippet->type & 0xff;
value = G_STRUCT_MEMBER_P(node, snippet->offset);
- if (strcmp(t->name, snippet->name) != 0)
+ if (strcmp(t->name, snippet->name) != 0 && snippet->name[0])
continue;
if (type == SNIPPET_NODE) {