Two problems here

(1) saxon:try / saxon:catch were superseded by xsl:try / xsl:catch. See the first paragraph at!changes/extensions/9.4-9.5

(2) the Saxon namespace isn't declared in "extension-element-prefixes", so it's not recognized as an (absent) extension element, and is rather treated as a literal result element. 

Michael Kay

On 12 Dec 2013, at 20:12, David Rudel <> wrote:

I'm trying to use the saxon:catch instruction for the first time, and I don't think it is doing anything.

I'm using oXygen and using Saxon-EE

I copied the example from the saxon documentation for Saxon:try into a bare stylesheet:

<xsl:stylesheet version="3.0" xmlns:xsl=""
    exclude-result-prefixes="xs xdt udf saxon math fn err exsl date">

    <xsl:template match="/">

<xsl:variable name="input-uri" select="'nofile'"/>
        <saxon:try select="document($input-uri)"> <saxon:catch errors="*"> <xsl:document> <error-document/> </xsl:document> </saxon:catch> </saxon:try>


I expected a synamic error since there is file with the name 'nofile".

Instead, it looks like the processor did not recognize this instruction as a saxon extension:

<?xml version="1.0" encoding="UTF-8"?><saxon:try xmlns:saxon="" select="document($input-uri)"><saxon:catch errors="*"><error-document/></saxon:catch></saxon:try>

I was surprised to see the "xmlns:saxon=""" annotation here given that I had excluded the saxon result prefix.

Is it possible that, for this extension, the "Version='3.0'" attribute is not sufficient to trigger the enhanced support? I know that in previous releases of Saxon some of the advanced features could not be triggered by using "Version = 3.0" when not called by the command line.



"A false conclusion, once arrived at and widely accepted is not dislodged easily, and the less it is understood, the more tenaciously it is held." - Cantor's Law of Preservation of Ignorance.
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
saxon-help mailing list archived at