New test for default namespace in calendar argument of format-date: Saxon bug 4168
authorMichael Kay <mike@saxonica.com>
Thu, 14 Mar 2019 16:00:52 +0000
changeset 2054 e3b9fc0f6ebb
parent 2053 6a8a2d04e099
child 2055 9cbda28a541d
New test for default namespace in calendar argument of format-date: Saxon bug 4168
tests/fn/format-date/_format-date-test-set.xml
tests/fn/format-date/format-date-037.xsl
--- a/tests/fn/format-date/_format-date-test-set.xml	Tue Mar 12 17:15:33 2019 +0000
+++ b/tests/fn/format-date/_format-date-test-set.xml	Thu Mar 14 16:00:52 2019 +0000
@@ -646,4 +646,19 @@
          <assert>/out = "  [QQQ]"</assert>
       </result>
    </test-case>
+   
+   <test-case name="format-date-037">
+      <description>Default namespace for calendar attribute: Saxon bug 4168</description>
+      <created by="Michael Kay after Christian Roth" on="2019-03-14"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="format-date-037.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <assert>not(contains(/*:out, "[Calendar:"))</assert>
+      </result>
+   </test-case>
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/fn/format-date/format-date-037.xsl	Thu Mar 14 16:00:52 2019 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0" exclude-result-prefixes="xs">
+  <?spec xslt#format-dateTime?>
+  <!-- PURPOSE: Saxon bug 4168: default namespace for calendar attribute -->
+  <xsl:template name="main">
+    <out xmlns="http://www.idpf.org/2007/opf">
+      <xsl:value-of select="format-date(current-date(), '[Y0001]-[M01]-[D01]', 'en', 'AD', ())"/>
+    </out>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file