summaryrefslogtreecommitdiffstats
path: root/lasso/xml/saml_conditions.c
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-11-17 17:18:51 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-11-17 17:18:51 +0000
commitcfc07351978eef632c1b06f06f7246c2860cfc9c (patch)
tree48a7d9f6507e35a980e530efad2f58b757510417 /lasso/xml/saml_conditions.c
parent5c353c8fe9b439478c333c7ec1604a4d12fcadaa (diff)
downloadlasso-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/saml_conditions.c')
-rw-r--r--lasso/xml/saml_conditions.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/lasso/xml/saml_conditions.c b/lasso/xml/saml_conditions.c
index 7108db1c..7bc9a06f 100644
--- a/lasso/xml/saml_conditions.c
+++ b/lasso/xml/saml_conditions.c
@@ -68,27 +68,18 @@ static int
init_from_xml(LassoNode *node, xmlNode *xmlnode)
{
LassoSamlConditions *conditions = LASSO_SAML_CONDITIONS(node);
- xmlNode *t;
+ struct XmlSnippet snippets[] = {
+ { "AudienceRestrictionCondition", 'n',
+ (void**)&(conditions->AudienceRestrictionCondition) },
+ { NULL, 0, NULL}
+ };
+
if (parent_class->init_from_xml(node, xmlnode))
return -1;
-
+ lasso_node_init_xml_with_snippets(xmlnode, snippets);
conditions->NotBefore = xmlGetProp(xmlnode, "NotBefore");
conditions->NotOnOrAfter = xmlGetProp(xmlnode, "NotOnOrAfter");
- t = xmlnode->children;
- while (t) {
- if (t->type != XML_ELEMENT_NODE) {
- t = t->next;
- continue;
- }
-
- if (strcmp(t->name, "AudienceRestrictionCondition") == 0) {
- conditions->AudienceRestrictionCondition =
- LASSO_SAML_AUDIENCE_RESTRICTION_CONDITION(
- lasso_node_new_from_xmlNode(t));
- }
- t = t->next;
- }
return 0;
}