programmatic metadata validation by the SP

Cantor, Scott cantor.2 at
Fri Feb 17 15:14:13 GMT 2012

On 2/17/12 8:24 AM, "Ian Young" <ian at> wrote:
>On 17 Feb 2012, at 09:38, Peter Schober wrote:
>> I should
>> probably check the exact meaning of TextContent somewhere/the XSD
>Incidentally, this is not a schema constraint in the XML Schema / XSD
>sense.  The constraint comes from SAML Core section 1.3.1, where it says
>that all "unless otherwise noted" xs:string elements "MUST consist of at
>least one non-whitespace character".  That's not expressible in the XML
>Schema language, which is why it has to be hand-coded.

It actually is expressible using minlength constraints, but there was
resistance that I should have just argued over for redefining the
xs:string type to be a subtype with the restriction. I do that in my own
schemas routinely.

re: the line number thing, the code doing the programmatic check doesn't
have access to any line numbers of anything else, it's running against the
DOM. Nothing I can really do, short of maybe some weird logging of the
surrounding elements I guess.

The only reason it's doing that checking is to guard against crashes. If
you have to check for null everywhere, you inevitably miss a spot, and
guarding the XML up front makes crashes less likely later.

But it makes the batch approach very problematic, which is why we
certainly see moving to MDX-style lookup of metadata as the right answer.

-- Scott

More information about the users mailing list