RE: [xsl] [XSLT 2.0] Checking that an element's value has the desired datatype?

Subject: RE: [xsl] [XSLT 2.0] Checking that an element's value has the desired datatype?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 17 Oct 2006 13:00:05 +0100
> > "Check that the aircraft's altitude is at least 500 feet 
> above all the 
> > vertical obstructions"
> 
> If you are using XML and a validation tool to work out if 
> there is an obstruction in the way of an aircraft then you 
> might find the aircraft has hit it before the result has been 
> returned...

That observation might appear flippant, but actually it's a good
illustration that this is not the right way to use validity constraints.
Schemas should be used to impose conditions that imply "this document is
meaningless, it doesn't make sense, it should be thrown in the bin and not
processed". They should not be used for conditions that say "if this
condition is true [or false], then special action is needed" - that's much
better done through a query language.

The same applies to a large number of integrity constraints you find in
database textbooks, such as "employees must be aged between 16 and 65".

Michael Kay
http://www.saxonica.com/

Current Thread