summaryrefslogtreecommitdiffstats
path: root/lasso/id-ff/name_registration.c
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2011-12-16 11:12:58 +0100
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2011-12-16 11:39:24 +0100
commit154812b401e3845977b3a4892dbc5e5a0b9d03cf (patch)
treebdd43fb563f124bbce837345ed7c25c11086831d /lasso/id-ff/name_registration.c
parent9a31985671edfaf877a1254e308bf7d61f1219fa (diff)
downloadlasso-154812b401e3845977b3a4892dbc5e5a0b9d03cf.tar.gz
lasso-154812b401e3845977b3a4892dbc5e5a0b9d03cf.tar.xz
lasso-154812b401e3845977b3a4892dbc5e5a0b9d03cf.zip
[xml] rewrite schema directed serialization/deserialization methods
The new implementations of lasso_node_impl_init_from_xml now validate namespace of all child nodes befores parsing. It stops on any error. For node which implement their own parsing of an attribute or a node, it must declare an XmlSnippet with an offset field set to 0. The 0 value is invalid for public GObject structure (it's the place of the GObject machinery like the reference count). The 0 offset can be used for XmlSnippet in a private structure, so never set the offset to 0 with the flag SNIPPET_PRIVATE, for a field which is parsed by you get_xmlNode virtual method. Other ameliorations in this commit is the possibility to set attributes with namespace when using the flags SNIPPET_ATTRIBUTE|SNIPPET_ANY. The syntax for an attribute is inspired by the element tree API from Python: {namespace}attribute_name an example: {http://www.w3.org/2001/XMLSchema-instance}type for the classic xsi:type attribute.
Diffstat (limited to 'lasso/id-ff/name_registration.c')
-rw-r--r--lasso/id-ff/name_registration.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lasso/id-ff/name_registration.c b/lasso/id-ff/name_registration.c
index 0badf76d..7d554902 100644
--- a/lasso/id-ff/name_registration.c
+++ b/lasso/id-ff/name_registration.c
@@ -645,6 +645,7 @@ lasso_name_registration_validate_request(LassoNameRegistration *name_registratio
static struct XmlSnippet schema_snippets[] = {
{ "OldNameIdentifier", SNIPPET_NODE_IN_CHILD,
G_STRUCT_OFFSET(LassoNameRegistration, oldNameIdentifier), NULL, NULL, NULL},
+ { "NameRegistrationDumpVersion", SNIPPET_ATTRIBUTE, 0, NULL, NULL, NULL},
{NULL, 0, 0, NULL, NULL, NULL}
};