tests/insn/try/try-032.xsl
changeset 1856 067c1e8d801d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/try/try-032.xsl	Wed Jun 13 12:37:24 2018 +0100
@@ -0,0 +1,17 @@
+<xsl:stylesheet exclude-result-prefixes="#all" version="3.0" 
+  xmlns:err="http://www.w3.org/2005/xqt-errors" xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <!-- Saxon bug 3791 - reference to $err:code in a predicate -->
+
+  <xsl:template name="main">
+    <out>
+      <xsl:variable as="xs:QName" name="my-err" select="xs:QName('my-err-local')" />
+      <xsl:try select="error($my-err)">
+        <xsl:catch>
+          <xsl:value-of select="'test:', 'Bang!'[$err:code eq $my-err]" />
+        </xsl:catch>
+      </xsl:try>
+    </out>  
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file