RE: [xsl] XSLT Processors in .NET and Schema-awareness

Subject: RE: [xsl] XSLT Processors in .NET and Schema-awareness
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 23 Sep 2005 17:34:53 +0100
> Begining from this last one, what exactly is "schema-awareness" when
> one talk about XSLTprocessors, what purposes it serves?

Schema awareness provides the following three features:

* the stylesheet can import a schema and use the types defined in the schema
in declarations of variables, functions, match patterns

* source documents can be validated against a schema, and the types assigned
to elements and attributes by the process of schema validation then
determine the types of values manipulated by the stylesheet

* result documents can be validated on the fly as they are constructed.

The main benefit of schema-awareness is that the software becomes more
robust, in the same way as Java is more robust than JavaScript. By
introducing stronger type-checking, you find the errors in your code more
quickly, with less need to generate exhaustive test cases (actually, no-one
writes exhaustive test cases; but you know that you should).

It also becomes possible to write code that is more generic and therefore
more reusable: for example, a template rule to format all dates, regardless
of the actual element or attribute name. The value of this increases as your
schemas and applications grow in size and complexity.

A potential extra benefit is improved performance, however, this depends on
the optimizer of the particular processor. 
> So my question are, what XSLT Processors exists that support XSL 2.0
> and XPath 2.0, and optionally that are "schema-aware", for the .NET
> platform?

There are currently two schema-aware XSLT 2.0 processors around: Saxon-SA
and Altova. Both will run on a .NET platform in some form, but neither is
native .NET code.

Michael Kay

Current Thread