Re: [xsl] Schema aware transformations

Subject: Re: [xsl] Schema aware transformations
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 22 Jun 2005 17:56:03 +0100
>>>>> "Andrew" == Andrew Welch <ajwelch@xxxxxxxxxxxxxxx> writes:

    >> To get the real benefit of schema-aware XSLT processing, you
    >> really need to start defining match patterns in terms of
    >> schema-declared elements and types, for example
    >> 
    >> <xsl:template
    >> match="schema-element(invoice)/delivery-address/postcode">
    Andrew> [snip]
    >> It's a fair investment to get started (time learning the ropes,
    >> and time establishing schemas for all your documents) but once
    >> you're over the curve, it makes the debugging cycle a
    >> completely different experience - instead of wrong or absent
    >> output, you get accustomed to expecting early error messages,
    >> often at compile time.

    Andrew> The problem here is that template
    Andrew> match="schema-element(abc)" gets rejected by the non-SA
    Andrew> processor.

You can work round this, using xsl:use-when, combined with the
system-property function (testing the xsl:is-schema-aware property),
to write stylesheets that will use the SA functionality if it is
available, and if not, degrade to basic functionality.

Of course, this means more work in writing the stylesheet in the first
place.

-- 
Colin Adams
Preston Lancashire

Current Thread