Add an error test case for function-available()
authorMichael Kay <mike@saxonica.com>
Sat, 02 Feb 2019 20:30:50 +0000
changeset 1960 b0b1af250597
parent 1959 28985bc9d1b6
child 1961 5b44c0b2ce57
Add an error test case for function-available()
tests/misc/error/_error-test-set.xml
tests/misc/error/error-1400c.xsl
--- a/tests/misc/error/_error-test-set.xml	Sat Feb 02 20:28:59 2019 +0000
+++ b/tests/misc/error/_error-test-set.xml	Sat Feb 02 20:30:50 2019 +0000
@@ -8198,6 +8198,24 @@
          <error code="XTDE1400"/>
       </result>
    </test-case>
+   
+   <test-case name="error-1400c">
+      <description>Generate error XTDE1400.
+         Was error-code-373.
+         function-available() with an argument computed at run-time, not a valid lexical NCName</description>
+      <created by="Michael Kay" on="2019-01-25"/>
+      <environment ref="error001"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-1400c.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <error code="XTDE1400"/>
+      </result>
+   </test-case>
 
    <test-case name="error-1420a">
       <description>Error: It is a non-recoverable dynamic
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/misc/error/error-1400c.xsl	Sat Feb 02 20:30:50 2019 +0000
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--It is a non-recoverable dynamic
+                  error if the argument passed to the
+                     function-available function does
+                  not evaluate to a string that is a valid EQName, or if the value is a lexical QName
+                  with a prefix for which no namespace declaration is present in the static context. If the processor
+                  is able to detect the error statically (for example, when the argument is
+                  supplied as a string literal), then the processor may
+                  optionally signal this as a static
+                     error.-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                xmlns:my="http://my.com/"
+                version="2.0">
+
+<?error XTDE1400?>
+
+  <xsl:param name="p" select="'2by4'"/>
+
+  <xsl:template name="main">
+    
+      <out>        
+          <xsl:sequence select="function-available($p)"/>        
+      </out>
+  </xsl:template>
+  
+
+
+
+</xsl:stylesheet>