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 9.5.1.2

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

<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:udf="user-defined"
    xmlns:fn="http://www.w3.org/2005/xpath-functions"
    xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
    xmlns:err="http://www.w3.org/2005/xqt-errors"
    xmlns:math="http://exslt.org/math"
    xmlns:saxon="http://saxon.sf.net/"
    xmlns:exsl="http://exslt.org/common"
    xmlns:date="http://exslt.org/dates-and-times"
    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>
       
    </xsl:template>

</xsl:stylesheet>

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="http://saxon.sf.net/" select="document($input-uri)"><saxon:catch errors="*"><error-document/></saxon:catch></saxon:try>

I was surprised to see the "xmlns:saxon="http://saxon.sf.net/"" 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.

-David

--

"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.