RE: [xsl] Re: xsl-list Digest 10 Sep 2004 05:10:00 -0000 Issue 173

Subject: RE: [xsl] Re: xsl-list Digest 10 Sep 2004 05:10:00 -0000 Issue 173
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Sat, 11 Sep 2004 19:21:38 +0100
> Hi, Michael: Thanks much for your response.
> Could you provide a brief description of what you have done 
> in Saxon-SA?

Saxon-SA implements the "schema-aware" facilities of the XSLT 2.0 working
draft. This means you can:

- validate your input documents against a schema

- process the input documents taking advantage of the type information
generated from schema processing

- validate the result document against a schema

- detect errors when the stylesheet makes incorrect assumptions about the
structure of the source or result documents.

For example, you can write template rules that process all elements of a
given type, or all elements in a substitution group. You can use an
"instance of" expression to test whether a value is of a given type. When
you sort or compare data values, the comparison is sensitive to the data
type. You can also write functions that declare the types of their arguments
and results, which gives you early indications of programming errors if you
call them with the wrong arguments.

One thing that I've found gives you a very immediate benefit is validating
the result document. Instead of producing output, validating it as a
separate operation, and then wondering what needs to change in the
stylesheet to correct the validity errors, you get an immediate error
message pointing to the place in the stylesheet where the invalid output was
generated.

Saxon SA 8.0 is the first release of a schema-aware XSLT processor and there
are plenty of opportunities to take more advantage of schema knowledge, both
for error checking and for performance optimization. For example, given a
common mistake like writing

<xsl:for-each select="row">
  <xsl:value-of select="row/code"/>

it should be possible to give a compile-time error (or at least a warning)
that the schema does not allow a row element to have children called row.

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

Current Thread