From cfc07351978eef632c1b06f06f7246c2860cfc9c Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Wed, 17 Nov 2004 17:18:51 +0000 Subject: refactored init_from_xml functions (lasso is now less than 20000 lines) --- lasso/xml/samlp_request.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'lasso/xml/samlp_request.c') diff --git a/lasso/xml/samlp_request.c b/lasso/xml/samlp_request.c index 958fd1df..079fe154 100644 --- a/lasso/xml/samlp_request.c +++ b/lasso/xml/samlp_request.c @@ -68,21 +68,15 @@ get_xmlNode(LassoNode *node) static int init_from_xml(LassoNode *node, xmlNode *xmlnode) { - xmlNode *t; + LassoSamlpRequest *request = LASSO_SAMLP_REQUEST(node); + struct XmlSnippet snippets[] = { + { "AssertionArtifact", 'c', (void**)&(request->AssertionArtifact) }, + { 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, "AssertionArtifact") == 0) { - LASSO_SAMLP_REQUEST(node)->AssertionArtifact = xmlNodeGetContent(t); - break; - } - } - t = t->next; - } + lasso_node_init_xml_with_snippets(xmlnode, snippets); return 0; } -- cgit