I think if I were writing a library for a vocabulary where schema validation is the norm (like FpML , say), and assuming that the schema is suitable for use in XQuery (most element names either global or having a named complex type) then I would declare the functions with types that assume the data is pre-validated. I wouldn’t expect client code to be invoking validate{} explicitly – I would expect that most of the time, the function is called to operate directly on input data, which is validated at source outside the query. (But that might not be how Zorba works, I don’t know.) The main reason is that it’s a good idea in an interface definition to be as precise as possible about what you expect to cross the interface
See the rest here:
Schema Typed Parameters and Return Values in Library
Modules
