diff options
author | Frederic Peters <fpeters@entrouvert.com> | 2004-11-17 17:18:51 +0000 |
---|---|---|
committer | Frederic Peters <fpeters@entrouvert.com> | 2004-11-17 17:18:51 +0000 |
commit | cfc07351978eef632c1b06f06f7246c2860cfc9c (patch) | |
tree | 48a7d9f6507e35a980e530efad2f58b757510417 /lasso/xml/samlp_response.c | |
parent | 5c353c8fe9b439478c333c7ec1604a4d12fcadaa (diff) | |
download | lasso-cfc07351978eef632c1b06f06f7246c2860cfc9c.tar.gz lasso-cfc07351978eef632c1b06f06f7246c2860cfc9c.tar.xz lasso-cfc07351978eef632c1b06f06f7246c2860cfc9c.zip |
refactored init_from_xml functions (lasso is now less than 20000 lines)
Diffstat (limited to 'lasso/xml/samlp_response.c')
-rw-r--r-- | lasso/xml/samlp_response.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/lasso/xml/samlp_response.c b/lasso/xml/samlp_response.c index c5545702..fc2bc8cd 100644 --- a/lasso/xml/samlp_response.c +++ b/lasso/xml/samlp_response.c @@ -79,26 +79,16 @@ get_xmlNode(LassoNode *node) static int init_from_xml(LassoNode *node, xmlNode *xmlnode) { - xmlNode *t; LassoSamlpResponse *response = LASSO_SAMLP_RESPONSE(node); + struct XmlSnippet snippets[] = { + { "Assertion", 'n', (void**)&(response->Assertion) }, + { "Status", 'n', (void**)&(response->Status) }, + { NULL, 0, NULL} + }; if (parent_class->init_from_xml(node, xmlnode)) return -1; - - t = xmlnode->children; - while (t) { - if (t->type == XML_ELEMENT_NODE) { - if (strcmp(t->name, "Assertion") == 0) { - response->Assertion = LASSO_SAML_ASSERTION( - lasso_node_new_from_xmlNode(t)); - } - if (strcmp(t->name, "Status") == 0) { - response->Status = LASSO_SAMLP_STATUS( - lasso_node_new_from_xmlNode(t)); - } - } - t = t->next; - } + lasso_node_init_xml_with_snippets(xmlnode, snippets); return 0; } |