RE: [xsl] Problem applying XSL to XML that uses a schema

Subject: RE: [xsl] Problem applying XSL to XML that uses a schema
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 9 Dec 2004 11:47:03 -0000
>   I thought, Schema Aware XSLT processor was
> neccessary in this case. But from your reply, it seems
> it is not required in this case.. Can you please tell,
> under what cases Schema Aware processor is required..?

A schema-aware processor is never actually required, but if you have a
schema for your source or result documents, then using a schema-aware XSLT
stylesheet gives you benefits. Broadly speaking these fall into three
categories:

(a) type-sensitive operations: operations such as comparison are
automatically sensitive to the data type, which saves you having to manually
convert data to the right type before doing the operation. Similarly
template matching can be based on schema types, which with a complex schema
makes it easier to write generic rules that cover a wide variety of
different elements.

(b) robustness: if the stylesheet knows the schema for the source and/or
result documents, then you get much better error messages when you make
programming mistakes, so you get a faster debugging cycle and the
reliability of your code is less dependent on exhaustive test coverage

(c) performance: schema information can potentially be used to optimize the
execution of the stylesheet.

I'm currently seeing (b) as the biggest benefit - it comes as quite a
surprise after years of XSLT 1.0 coding to get compile-time error messages
when you spell an attribute name incorrectly.

Thanks for the invitation to do a sales pitch!

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

Current Thread