diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2004-11-26 08:58:46 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2004-11-26 08:58:46 +0000 |
| commit | 0a7d907fc8d894f7758b69a2ee46c1aac63f4f7c (patch) | |
| tree | 37d3ed4ba0d97e1b8c41561d6d124aa0a075d9d2 | |
| parent | 312f5de306ca7927389498c7f902e73d00fc8a99 (diff) | |
use xmlsnippets in <saml:AuthorityBinding>
| -rw-r--r-- | lasso/xml/saml_authority_binding.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/lasso/xml/saml_authority_binding.c b/lasso/xml/saml_authority_binding.c index e12a58b0..ce8b565f 100644 --- a/lasso/xml/saml_authority_binding.c +++ b/lasso/xml/saml_authority_binding.c @@ -40,22 +40,27 @@ /* private methods */ /*****************************************************************************/ +#define snippets() \ + LassoSamlAuthorityBinding *binding = LASSO_SAML_AUTHORITY_BINDING(node); \ + struct XmlSnippet snippets[] = { \ + { "AuthorityKind", 'a', (void**)&(binding->AuthorityKind) }, \ + { "Location", 'a', (void**)&(binding->Location) }, \ + { "Binding", 'a', (void**)&(binding->Binding) }, \ + { NULL, 0, NULL} \ + }; + + static LassoNodeClass *parent_class = NULL; static xmlNode* get_xmlNode(LassoNode *node) { xmlNode *xmlnode; - LassoSamlAuthorityBinding *binding = LASSO_SAML_AUTHORITY_BINDING(node); + snippets(); xmlnode = xmlNewNode(NULL, "AuthorityBinding"); xmlSetNs(xmlnode, xmlNewNs(xmlnode, LASSO_SAML_ASSERTION_HREF, LASSO_SAML_ASSERTION_PREFIX)); - if (binding->AuthorityKind) - xmlSetProp(xmlnode, "AuthorityKind", binding->AuthorityKind); - if (binding->Location) - xmlSetProp(xmlnode, "Location", binding->Location); - if (binding->Binding) - xmlSetProp(xmlnode, "Binding", binding->Binding); + lasso_node_build_xml_with_snippets(xmlnode, snippets); return xmlnode; } @@ -63,14 +68,11 @@ get_xmlNode(LassoNode *node) static int init_from_xml(LassoNode *node, xmlNode *xmlnode) { - LassoSamlAuthorityBinding *binding = LASSO_SAML_AUTHORITY_BINDING(node); + snippets(); if (parent_class->init_from_xml(node, xmlnode)) return -1; - - binding->AuthorityKind = xmlGetProp(xmlnode, "AuthorityKind"); - binding->Location = xmlGetProp(xmlnode, "Location"); - binding->Binding = xmlGetProp(xmlnode, "Binding"); + lasso_node_init_xml_with_snippets(xmlnode, snippets); return 0; } |
