tests/decl/override/override-misc-007.xsl
author Michael Kay <mike@saxonica.com>
Tue, 18 Aug 2015 18:22:28 +0100
changeset 1045 6d51333a8d63
parent 840 e80670ae04c0
child 1186 7f4cefa4b568
permissions -rw-r--r--
Various corrections to xsl:override tests
840
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     1
<xsl:package 
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     2
  name="http://www.w3.org/xslt30tests/override-001"
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     3
  package-version="1.0.1"
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     4
  version="3.0"
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     5
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     6
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     7
  xmlns:p="http://www.w3.org/xslt30tests/override-base-misc-002"
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     8
  exclude-result-prefixes="xs p">
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     9
  
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    10
  
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    11
  <xsl:use-package
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    12
    name="http://www.w3.org/xslt30tests/override-base-misc-002"
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    13
    package-version="1.0.0"/>
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    14
    
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    15
  <!-- Streamed accumulators in different packages can share the same name -->
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    16
  
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    17
  <xsl:accumulator name="ac" initial-value="0" streamable="yes">
1045
6d51333a8d63 Various corrections to xsl:override tests
Michael Kay <mike@saxonica.com>
parents: 840
diff changeset
    18
    <xsl:accumulator-rule match="*" select="$value - 1"></xsl:accumulator-rule>
840
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    19
  </xsl:accumulator>
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    20
  
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    21
  <xsl:template name="use-this" visibility="public">
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    22
    <xsl:stream href="../accumulator/books.xml" use-accumulators="ac">
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    23
      <b><count nodes="{count(//*)}"/><acc value="{accumulator-after('ac')}"/></b>
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    24
    </xsl:stream>  
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    25
  </xsl:template>
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    26
   
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    27
    <xsl:template name="main">
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    28
        <out>
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    29
          <xsl:call-template name="use-base"/>
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    30
          <xsl:call-template name="use-this"/>
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    31
        </out>   
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    32
    </xsl:template>
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    33
    
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    34
 
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    35
  
e80670ae04c0 Reorganized xsl:override tests
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    36
</xsl:package>