tests/insn/try/try-032.xsl
author Michael Kay <mike@saxonica.com>
Wed, 13 Jun 2018 12:37:24 +0100
changeset 1856 067c1e8d801d
permissions -rw-r--r--
Regression test for saxon bug: $err:code within a predicate
1856
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     1
<xsl:stylesheet exclude-result-prefixes="#all" version="3.0" 
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     2
  xmlns:err="http://www.w3.org/2005/xqt-errors" xmlns:xs="http://www.w3.org/2001/XMLSchema" 
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     3
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     4
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     5
  <!-- Saxon bug 3791 - reference to $err:code in a predicate -->
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     6
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     7
  <xsl:template name="main">
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     8
    <out>
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     9
      <xsl:variable as="xs:QName" name="my-err" select="xs:QName('my-err-local')" />
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    10
      <xsl:try select="error($my-err)">
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    11
        <xsl:catch>
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    12
          <xsl:value-of select="'test:', 'Bang!'[$err:code eq $my-err]" />
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    13
        </xsl:catch>
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    14
      </xsl:try>
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    15
    </out>  
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    16
  </xsl:template>
067c1e8d801d Regression test for saxon bug: $err:code within a predicate
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    17
</xsl:stylesheet>