From: Andrea Zagli Date: Sat, 7 Nov 2015 21:11:18 +0000 (+0100) Subject: Loading of filters and validators from xml. X-Git-Tag: v0.1.0~3^2~25 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=5239e5065512fc1bfdf31614dd085e36f4b9cbe1;p=libzakcgi Loading of filters and validators from xml. --- diff --git a/tests/form_xml.c b/tests/form_xml.c index 517c903..970b5da 100644 --- a/tests/form_xml.c +++ b/tests/form_xml.c @@ -38,6 +38,9 @@ main (int argc, char *argv[]) GString *str; + GValue *val; + gchar *filename; + ZakCgiForm *form; ZakCgiFormElement *element; @@ -57,13 +60,15 @@ main (int argc, char *argv[]) "\n" "
\n"); + val = zak_cgi_main_get_parameter (zakcgimain, "filename"); + filename = (gchar *)g_value_get_string (val); + form = zak_cgi_form_new (zakcgimain, "method", "post", - "action", "form", + "action", g_strdup_printf ("form_xml?filename=%s", filename), NULL); - GValue *val = zak_cgi_main_get_parameter (zakcgimain, "filename"); - if (zak_form_form_load_from_file (ZAK_FORM_FORM (form), g_value_get_string (val))) + if (zak_form_form_load_from_file (ZAK_FORM_FORM (form), filename)) { if (zak_cgi_main_is_post (zakcgimain)) { diff --git a/tests/form_xml.xml b/tests/form_xml.xml index 34ef91f..5146bd1 100644 --- a/tests/form_xml.xml +++ b/tests/form_xml.xml @@ -4,6 +4,8 @@ first + + ^blahblahblah$