Test that xsl:exclude-result-prefixes applies to URIs, not to prefixes default tip
authorMichael Kay <mike@saxonica.com>
Fri, 14 Dec 2018 23:38:22 +0000
changeset 1930 c4dff19ec90a
parent 1929 2f9b80ba010e
Test that xsl:exclude-result-prefixes applies to URIs, not to prefixes
tests/type/namespace/_namespace-test-set.xml
tests/type/namespace/namespace-0911.xsl
--- a/tests/type/namespace/_namespace-test-set.xml	Fri Dec 14 23:37:11 2018 +0000
+++ b/tests/type/namespace/_namespace-test-set.xml	Fri Dec 14 23:38:22 2018 +0000
@@ -699,6 +699,30 @@
          <assert-xml><![CDATA[<out><check>true</check><check>true</check><check>true</check></out>]]></assert-xml>
       </result>
    </test-case>
+   
+   <test-case name="namespace-0911">
+      <description>Check that exclude-result-prefixes applies to URIs, not to prefixes</description>
+      <created by="Michael Kay" on="2018-11-20"/>
+      <environment ref="namespace-09"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="namespace-0911.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/alpha/namespace::b = 'b.uri'</assert>
+            <assert>/alpha/beta/namespace::c = 'e.uri'</assert>
+            <assert>empty(/alpha/namespace::a)</assert>
+            <assert>empty(/alpha/namespace::c)</assert>
+            <assert>empty(/alpha/beta/namespace::a)</assert>
+            <assert>/alpha/beta/namespace::b = 'b.uri'</assert>
+         </all-of>
+        
+      </result>
+   </test-case>
 
    <test-case name="namespace-1101">
       <description>TEST xsl:namespace (XSLT 2.0)</description>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/type/namespace/namespace-0911.xsl	Fri Dec 14 23:38:22 2018 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0"?> 
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+
+  <!-- PURPOSE: Check that exclude-result-prefixes applies to URIs, not prefixes -->
+  
+  <xsl:template name="main">
+    <alpha xmlns:a="a.uri" xmlns:b="b.uri" xmlns:c="c.uri" xsl:exclude-result-prefixes="a c">
+      <beta xmlns:a="c.uri" xmlns:b="d.uri" xmlns:c="e.uri" xsl:exclude-result-prefixes="b"/>
+    </alpha>
+  </xsl:template>
+
+</xsl:stylesheet>