Add a strict mode for lasso_node_init_from_xml
We already have some form of schema through the XmlSnippet structures. I think we could add more strict checking with some more flags and checking.
First we could check strict ordering since XSchema suppose it. That is we would match the sub-elements in-order unless specified otherwise (they are in an <xs:choice/>). As the XmlSnippet cannot be nested, the flag would be put on the sub-elements contained in the choice and would mean "don't care about my order", SNIPPET_UNORDERED wouldbe a good name.Second we could check cardinality. I think there is only three cardinalities used in SAML standards:
- needed (1)
- optional (0 or 1)
- optional-free (0 or more)
that could be mapped to three new flags: SNIPPET_NEEDED, SNIPPET_OPTIONAL and SNIPPET_OPTIONAL_FREE.
We could even implement a script to check that all SNIPPET_OPTIONAL_FREE points to properly declared GList fields.