[Bug 3818] Static typing of $input-context1/works[1]/employee[1]/empnum[1]

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3818





------- Comment #10 from mike@saxonica.com  2006-11-03 10:36 -------
"The use of static typing can alert users to the possibility of unforseen
dynamic errors.  While I appreciate your viewpoint, my personal opinion is that
I'd rather know of a potential problem at query compile time than at some point
in the future..."

No quarrel with that. But the vast majority of these tests are schemaless.
Without a schema, mistyping an element name in a path such as /a/b/c is not
going to give you a compile time error. The only thing it will give you is a
cardinality error if you use it somewhere that a singleton is required. Nine
times out of ten that error is spurious because the user knows that x/@price is
actually a singleton, and having to assert it with a "treat" doesn't add much
value. Static typing in the absence of a schema, in my view, detects more
spurious errors than real errors, and it fails to detect most real errors. In
the presence of a schema, by contrast, most real errors (such as mistyping an
element name) can be picked up just as well (at compile time) by an optimistic
static typing system as by a pessimistic one, while also reporting far fewer
spurious errors.

Received on Friday, 3 November 2006 10:36:25 UTC