Merge
authordebbie
Fri, 08 Aug 2014 14:37:34 +0100
changeset 600 f6047a0547ac
parent 599 79fc2db2b426 (current diff)
parent 592 8709b14f60a1 (diff)
child 601 075e4646d4bd
Merge
tests/decl/accumulator/_accumulator-test-set.xml
tests/insn/copy/_copy-test-set.xml
--- a/admin/catalog-schema.xsd	Fri Aug 08 14:36:24 2014 +0100
+++ b/admin/catalog-schema.xsd	Fri Aug 08 14:37:34 2014 +0100
@@ -242,6 +242,7 @@
             <xs:attribute name="select" type="xs:string" use="optional"/>
             <xs:attribute name="as" type="xs:string" use="optional"/>
             <xs:attribute name="source" type="xs:string" use="optional"/>
+            <xs:attribute name="static" type="yesNoType" use="optional"/>
         </xs:complexType>
     </xs:element>
 
@@ -2037,6 +2038,13 @@
             <xs:enumeration value="skip"/>
         </xs:restriction>
     </xs:simpleType>
+    
+    <xs:simpleType name="yesNoType">
+        <xs:restriction base="xs:normalizedString">
+            <xs:enumeration value="yes"/>
+            <xs:enumeration value="no"/>
+        </xs:restriction>
+    </xs:simpleType>
 
 
     <xs:attributeGroup name="valueAttr">
--- a/tests/decl/accumulator/_accumulator-test-set.xml	Fri Aug 08 14:36:24 2014 +0100
+++ b/tests/decl/accumulator/_accumulator-test-set.xml	Fri Aug 08 14:37:34 2014 +0100
@@ -548,8 +548,8 @@
       </dependencies>
       <test>
          <stylesheet file="accumulator-032.xsl"/>
+         <param name="streamable" static="yes" select="'no'"/>
          <initial-template name="main"/>
-         <param name="streamable" static="yes" select="'no'"/>
       </test>
       <result>
          <assert>/o = '21'</assert>
@@ -564,8 +564,8 @@
       </dependencies>
       <test>
          <stylesheet file="accumulator-032.xsl"/>
+         <param name="streamable" static="yes" select="'no'"/>
          <initial-template name="main"/>
-         <param name="streamable" static="yes" select="'no'"/>
       </test>
       <result>
          <assert>/o = '21'</assert>
--- a/tests/fn/json-to-xml/_json-to-xml-test-set.xml	Fri Aug 08 14:36:24 2014 +0100
+++ b/tests/fn/json-to-xml/_json-to-xml-test-set.xml	Fri Aug 08 14:37:34 2014 +0100
@@ -17,7 +17,7 @@
     <!-- It would be helpful to assert schema-awareness on the stylesheet in a shared environment
     Sadly 'dependencies' aren't appropriate and just adding 'schema' doesn't mean the same thing -->
     <environment name="json-to-xml-typed">
-        <namespace prefix="j" uri="http://www.w3.org/2013/XSL/json"/>
+        <!--<namespace prefix="j" uri="http://www.w3.org/2013/XSL/json"/>-->
         <!-- <schema uri="http://www.w3.org/2013/XSL/json" file="schema-for-json.xsd">
             <description>JSON XML representation schema</description>
             <created by="John Lumley" on="2013-10-03"/>
@@ -194,7 +194,6 @@
         </test>
         <result>
             <all-of>
-                <assert-count>1</assert-count>
                 <assert>* instance of element(Q{http://www.w3.org/2013/XSL/json}string)</assert>
                 <assert>. = 'Data with " within it'</assert>
                 <any-of>
@@ -217,7 +216,6 @@
         </test>
         <result>
             <all-of>
-                <assert-count>1</assert-count>
                 <assert>* instance of element(Q{http://www.w3.org/2013/XSL/json}string)</assert>
                 <assert>. = 'Data with " within it'</assert>
                 <assert>*/@key eq 'Key " with quote'</assert>
@@ -241,7 +239,6 @@
         </test>
         <result>
             <all-of>
-                <assert-count>1</assert-count>
                 <assert>* instance of element(Q{http://www.w3.org/2013/XSL/json}string)</assert>
                 <assert>. = 'Data with \" within it'</assert>
                 <assert>*/@escaped eq "true"</assert>
@@ -261,7 +258,6 @@
         </test>
         <result>
             <all-of>
-                <assert-count>1</assert-count>
                 <assert>* instance of element(Q{http://www.w3.org/2013/XSL/json}string)</assert>
                 <assert>. = 'Data with \" within it'</assert>
                 <assert>*/@key eq 'Key \" with quote'</assert>
--- a/tests/insn/copy/_copy-test-set.xml	Fri Aug 08 14:36:24 2014 +0100
+++ b/tests/insn/copy/_copy-test-set.xml	Fri Aug 08 14:37:34 2014 +0100
@@ -1554,6 +1554,28 @@
          <assert-xml file="copy-3701.out"/>
       </result>
    </test-case>
+   
+   <test-case name="copy-3702">
+      <description>Test that in-scope namespaces are copied (Saxon bug repro)</description>
+      <created by="Michael Kay" on="2014-08-05"/>
+      <environment ref="copy-37"/>
+      <dependencies>
+         <spec value="XSLT10+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="copy-3702.xsl"/>
+      </test>
+      <result>
+         <!--xml||tns|ns1|ns2-->
+         <all-of>
+           <assert>tokenize(/*, '\|') = 'xml'</assert>
+           <assert>tokenize(/*, '\|') = ''</assert>
+           <assert>tokenize(/*, '\|') = 'tns'</assert>
+           <assert>tokenize(/*, '\|') = 'ns1'</assert>
+           <assert>tokenize(/*, '\|') = 'ns2'</assert>
+         </all-of>
+      </result>
+   </test-case>
 
    <test-case name="copy-3801">
       <description>FileName: copy56 Document: http://www.w3.org/TR/xslt DocVersion: 19991116
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/copy/copy-3702.xsl	Fri Aug 08 14:37:34 2014 +0100
@@ -0,0 +1,25 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+               xmlns:f="http://www.w3.org/2005/Atom"
+               xmlns:xs="http://www.w3.org/2001/XMLSchema"
+               version="2.0">
+
+   <!-- This stylesheet is a repro of Saxon bug 2123. It is designed to check
+     that the in-scope namespaces of a copied node are correct. The particular
+     use of a pseudo-recursive function to create the copy is designed to take
+     Saxon down a particular path where the copy is a virtual copy of the original
+     node rather than a physical copy -->
+
+   <xsl:template match="/">
+      <p><xsl:value-of select="f:firstType(.,1)/in-scope-prefixes(.)" separator="|"/></p>
+   </xsl:template>
+   
+   <xsl:function name="f:firstType">
+     <xsl:param name="doc" as="node()"/>
+     <xsl:param name="which" as="xs:integer"/>
+     <xsl:copy-of select="($doc/*/*)[$which]"/>
+     <xsl:if test="$which lt 100">
+       <xsl:sequence select="f:firstType($doc, 120)"/>
+     </xsl:if>  
+   </xsl:function>
+
+</xsl:stylesheet>
\ No newline at end of file
--- a/tests/misc/catalog/schema-for-xslt30.xsd	Fri Aug 08 14:36:24 2014 +0100
+++ b/tests/misc/catalog/schema-for-xslt30.xsd	Fri Aug 08 14:37:34 2014 +0100
@@ -244,12 +244,14 @@
           </xs:sequence>
           <xs:attribute name="name" type="xsl:EQName" />
           <xs:attribute name="post-descent" type="xsl:EQName" />
+          <xs:attribute name="applies-to" type="xsl:pattern"/>
           <xs:attribute name="initial-value" type="xsl:expression"/>
           <xs:attribute name="as" type="xsl:sequence-type"/>
           <xs:attribute name="visibility" type="xsl:visibility-type"/>
           <xs:attribute name="streamable" type="xsl:yes-or-no"/>
           <xs:attribute name="_name" type="xs:string" />
           <xs:attribute name="_post-descent" type="xs:string" />
+          <xs:attribute name="_applies-to" type="xs:string"/> 
           <xs:attribute name="_initial-value" type="xs:string"/>
           <xs:attribute name="_as" type="xs:string"/>
           <xs:attribute name="_visibility" type="xs:string"/>
@@ -261,8 +263,8 @@
 
   <xs:element name="accumulator-rule">
     <xs:complexType>
-      <xs:complexContent>
-        <xs:extension base="xsl:element-only-versioned-element-type">
+      <xs:complexContent mixed="true">
+        <xs:extension base="xsl:sequence-constructor-or-select">
           <xs:sequence/>
           <xs:attribute name="match" type="xsl:pattern"/>
           <xs:attribute name="phase">
@@ -273,12 +275,9 @@
               </xs:restriction>           
             </xs:simpleType>
           </xs:attribute>
-          <xs:attribute name="select" type="xsl:expression"/>
           <xs:attribute name="_match" type="xs:string"/>
           <xs:attribute name="_phase" type="xs:string"/>
-          <xs:attribute name="_select" type="xs:string"/>
           <xs:assert test="exists(@match | @_match)"/>
-          <xs:assert test="exists(@select | @_select)"/>
         </xs:extension>
       </xs:complexContent>
     </xs:complexType>
@@ -771,10 +770,19 @@
     <xs:complexType>
       <xs:complexContent mixed="true">
         <xs:extension base="xsl:versioned-element-type">
-          <xs:choice minOccurs="1" maxOccurs="unbounded">
-            <xs:element ref="xsl:sequence"/>
-            <xs:element ref="xsl:fallback"/>
-          </xs:choice>
+          <xs:sequence>
+            <xs:element ref="xsl:fallback" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:choice>
+              <xs:sequence minOccurs="0" maxOccurs="unbounded">
+                <xs:element ref="xsl:sequence"/>
+                <xs:element ref="xsl:fallback" minOccurs="0" maxOccurs="unbounded"/>
+              </xs:sequence>
+              <xs:sequence>
+                <xs:element ref="xsl:for-each-group"/>
+                <xs:element ref="xsl:fallback" minOccurs="0" maxOccurs="unbounded"/>
+              </xs:sequence>
+            </xs:choice>
+          </xs:sequence>
         </xs:extension>
       </xs:complexContent>
     </xs:complexType>
@@ -830,6 +838,30 @@
       </xs:complexContent>
     </xs:complexType>
   </xs:element>
+  
+  <xs:element name="global-context-item">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xsl:element-only-versioned-element-type">
+          <xs:attribute name="as" type="xsl:item-type"/>
+          <xs:attribute name="use">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="required"/>
+                <xs:enumeration value="optional"/>
+                <xs:enumeration value="prohibited"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="streamable" type="xsl:yes-or-no"/>
+          <xs:attribute name="_as" type="xs:string"/>
+          <xs:attribute name="_use" type="xs:string"/>
+          <xs:attribute name="_streamable" type="xs:string"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  
 
   <xs:element name="if" substitutionGroup="xsl:instruction">
     <xs:complexType>
@@ -1095,6 +1127,8 @@
           <xs:attribute name="_result-prefix" type="xs:string"/>
           <xs:assert test="exists(@stylesheet-prefix | @_stylesheet-prefix)"/>
           <xs:assert test="exists(@result-prefix | @_result-prefix)"/>
+          <xs:assert test="every $prefix in (@stylesheet-prefix, @result-prefix)[. ne '#default']
+            satisfies $prefix = in-scope-prefixes(.)"/>
         </xs:extension>
       </xs:complexContent>
     </xs:complexType>
@@ -1180,6 +1214,7 @@
       <xs:complexContent mixed="true">
         <xs:extension base="xsl:generic-element-type">
           <xs:attribute name="name" type="xsl:EQName"/>
+          <xs:attribute name="recoverable" type="xsl:yes-or-no"/>
           <xs:attribute name="method" type="xsl:method"/>
           <xs:attribute name="byte-order-mark" type="xsl:yes-or-no"/>
           <xs:attribute name="cdata-section-elements" type="xsl:EQNames"/>
@@ -1286,12 +1321,9 @@
             <xs:choice minOccurs="0" maxOccurs="unbounded">
               <xs:element ref="xsl:use-package"/>
               <xs:element ref="xsl:expose"/>
+              <xs:element ref="xsl:transform"/>
+              <xs:element ref="xsl:global-context-item"/>
             </xs:choice>  
-            <xs:element ref="xsl:transform" minOccurs="1" maxOccurs="1"/>
-            <xs:choice minOccurs="0" maxOccurs="unbounded">
-              <xs:element ref="xsl:use-package"/>
-              <xs:element ref="xsl:expose"/>
-            </xs:choice>
           </xs:sequence>
           <xs:attribute name="name" type="xs:anyURI"/>
           <xs:attribute name="package-version" type="xs:string"/>
@@ -1351,7 +1383,7 @@
               </xs:annotation>
             </xs:assert>
           <xs:assert test="if (normalize-space(@static) = 'yes')
-                           then empty((*,text())) and exists(@select)
+                           then empty((*,text()))
                            else true()">
             <xs:annotation>
               <xs:documentation>
@@ -1422,6 +1454,7 @@
           <xs:attribute name="href" type="xsl:avt"/>
           <xs:attribute name="type" type="xsl:EQName"/>
           <xs:attribute name="validation" type="xsl:validation-type"/>
+          <xs:attribute name="recoverable" type="xsl:avt"/>
           <xs:attribute name="method" type="xsl:avt"/>
           <xs:attribute name="byte-order-mark" type="xsl:avt"/>
           <xs:attribute name="cdata-section-elements" type="xsl:avt"/>
@@ -1693,6 +1726,19 @@
               </xs:documentation>
             </xs:annotation>
           </xs:assert>
+          <xs:assert test="every $prefix in (@exclude-result-prefixes[not(. = '#all')], @extension-element-prefixes)
+            satisfies ((if ($prefix = '#default') then '' else $prefix) = in-scope-prefixes(.))">
+            <xs:annotation>
+              <xs:documentation>
+                <p>XTSE0808: It is a static error if a namespace prefix is used within the [xsl:]exclude-result-prefixes 
+                  attribute and there is no namespace binding in scope for that prefix.
+                </p>
+                <p>XTSE0809: It is a static error if the value #default is used within the [xsl:]exclude-result-prefixes 
+                  attribute and the parent element of the [xsl:]exclude-result-prefixes attribute has no default namespace.
+                </p>
+              </xs:documentation>
+            </xs:annotation>
+          </xs:assert>
         </xs:extension>
       </xs:complexContent>
     </xs:complexType>
@@ -2215,6 +2261,10 @@
     <xs:restriction base="xs:token">
       <xs:enumeration value="yes"/>
       <xs:enumeration value="no"/>
+      <xs:enumeration value="true"/>
+      <xs:enumeration value="false"/>
+      <xs:enumeration value="1"/>
+      <xs:enumeration value="0"/>
       <xs:enumeration value="strict"/>
       <xs:enumeration value="lax"/>
       <xs:enumeration value="unspecified"/>
@@ -2278,21 +2328,30 @@
 
   <xs:simpleType name="yes-or-no">
     <xs:annotation>
-      <xs:documentation> One of the values "yes" or "no". </xs:documentation>
+      <xs:documentation> One of the values "yes" or "no": the values "true" or "false", or "1" or "0" are accepted as synonyms. </xs:documentation>
     </xs:annotation>
     <xs:restriction base="xs:token">
       <xs:enumeration value="yes"/>
       <xs:enumeration value="no"/>
+      <xs:enumeration value="true"/>
+      <xs:enumeration value="false"/>
+      <xs:enumeration value="1"/>
+      <xs:enumeration value="0"/>
     </xs:restriction>
   </xs:simpleType>
 
   <xs:simpleType name="yes-or-no-or-omit">
     <xs:annotation>
-      <xs:documentation> One of the values "yes" or "no" or "omit". </xs:documentation>
+      <xs:documentation> One of the values "yes" or "no" or "omit". 
+        The values "true" or "false", or "1" or "0" are accepted as synonyms of "yes" and "no" respectively.</xs:documentation>
     </xs:annotation>
     <xs:restriction base="xs:token">
       <xs:enumeration value="yes"/>
       <xs:enumeration value="no"/>
+      <xs:enumeration value="true"/>
+      <xs:enumeration value="false"/>
+      <xs:enumeration value="1"/>
+      <xs:enumeration value="0"/>
       <xs:enumeration value="omit"/>
     </xs:restriction>
   </xs:simpleType>
--- a/tests/strm/si-iterate/_si-iterate-test-set.xml	Fri Aug 08 14:36:24 2014 +0100
+++ b/tests/strm/si-iterate/_si-iterate-test-set.xml	Fri Aug 08 14:37:34 2014 +0100
@@ -282,7 +282,13 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <assert-xml><![CDATA[<tba/>]]></assert-xml>
+         <all-of>
+            <assert>/elements/e[@name="gml:pos"]/@count="4070"</assert>
+            <assert>/elements/e[@name="bldg:Building"]/@count="14"</assert>
+            <assert>/elements/e[@name="cityObjectMember"]/@count="15"</assert>
+            <assert>/elements/e[@name="app:TexCoordList"]/@count="295"</assert>
+            <assert>/elements/e[@name="bldg:boundedBy"]/@count="812"</assert>
+         </all-of>
       </result>
    </test-case>
    
@@ -295,7 +301,18 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <assert-xml><![CDATA[<tba/>]]></assert-xml>
+         <all-of>
+            <assert>/elements/e[1][@name="CityModel" and @count="1"]</assert>
+            <assert>/elements/e[2][@name="app:Appearance" and @count="1"]</assert>
+            <assert>/elements/e[3][@name="app:GeoreferencedTexture" and @count="1"]</assert>
+            <assert>/elements/e[4][@name="app:ParameterizedTexture" and @count="295"]</assert>
+            <assert>/elements/e[5][@name="app:TexCoordList" and @count="295"]</assert>
+            <assert>/elements/e[6][@name="app:X3DMaterial" and @count="2"]</assert>
+            <assert>/elements/e[7][@name="app:appearanceMember" and @count="1"]</assert>
+            <assert>/elements/e[8][@name="app:borderColor" and @count="295"]</assert>
+            <assert>/elements/e[9][@name="app:diffuseColor" and @count="2"]</assert>
+            <assert>/elements/e[10][@name="app:imageURI" and @count="296"]</assert>
+         </all-of>
       </result>
    </test-case>
 
--- a/tests/strm/si-iterate/si-iterate-134.xsl	Fri Aug 08 14:36:24 2014 +0100
+++ b/tests/strm/si-iterate/si-iterate-134.xsl	Fri Aug 08 14:37:34 2014 +0100
@@ -1,7 +1,7 @@
 <?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" xmlns:map="http://www.w3.org/2005/xpath-functions/map"
-  exclude-result-prefixes="xs" version="3.0">
+  exclude-result-prefixes="xs map" version="3.0">
   <xsl:template name="main">
     <xsl:stream href="../docs/citygml.xml">
       <elements>
@@ -18,7 +18,7 @@
           </xsl:iterate>
         </xsl:variable>
         <xsl:for-each select="map:keys($histogram)">
-          <e name="{.}" count="$histogram(.)"/>
+          <e name="{.}" count="{$histogram(.)}"/>
         </xsl:for-each>
       </elements>
     </xsl:stream>
--- a/tests/strm/si-iterate/si-iterate-135.xsl	Fri Aug 08 14:36:24 2014 +0100
+++ b/tests/strm/si-iterate/si-iterate-135.xsl	Fri Aug 08 14:37:34 2014 +0100
@@ -1,7 +1,7 @@
 <?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" xmlns:map="http://www.w3.org/2005/xpath-functions/map"
-  exclude-result-prefixes="xs" version="3.0">
+  exclude-result-prefixes="xs map" version="3.0">
   <xsl:template name="main">
     <xsl:stream href="../docs/citygml.xml">
       <elements>
@@ -19,7 +19,7 @@
         </xsl:variable>
         <xsl:for-each select="map:keys($histogram)">
           <xsl:sort select="."/>
-          <e name="{.}" count="$histogram(.)"/>
+          <e name="{.}" count="{$histogram(.)}"/>
         </xsl:for-each>
       </elements>
     </xsl:stream>