Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / docx / from / dynamic / tests / xspec / test-toc-scenario.xsl @ 187

History | View | Annotate | Download (3.4 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet xmlns:test="http://www.jenitennison.com/xslt/unit-test"
3
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
                xmlns:s="http://www.jenitennison.com/xslt/xspec"
5
                xmlns:o="http://www.w3.org/1999/XSL/TransformAliasAlias"
6
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
7
                xmlns:x="http://www.jenitennison.com/xslt/xspec"
8
                xmlns:tei="http://www.tei-c.org/ns/1.0"
9
                xmlns="http://www.tei-c.org/ns/1.0"
10
                version="2.0">
11
   <xsl:import href="file:/usr/local/bin/xspec-v0.1/generate-tests-utils.xsl"/>
12
   <xsl:import href="file:/Users/amittelbach/EDV%20Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl"/>
13
   <xsl:namespace-alias stylesheet-prefix="o" result-prefix="xsl"/>
14
   <xsl:variable name="s:stylesheet-uri" as="xs:string"
15
                 select="'file:/Users/amittelbach/EDV%20Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl'"/>
16
   <xsl:output method="xml" indent="yes"/>
17
   <xsl:template name="s:main">
18
      <xsl:message>
19
         <xsl:text>Testing with </xsl:text>
20
         <xsl:value-of select="system-property('xsl:product-name')"/>
21
         <xsl:text> </xsl:text>
22
         <xsl:value-of select="system-property('xsl:product-version')"/>
23
      </xsl:message>
24
      <xsl:processing-instruction name="xml-stylesheet">type="text/xsl" href="file:/usr/local/bin/xspec-v0.1/format-xspec-report.xsl"</xsl:processing-instruction>
25
      <s:report stylesheet="{$s:stylesheet-uri}" date="{current-dateTime()}">
26
         <xsl:call-template name="s:d4e1"/>
27
      </s:report>
28
   </xsl:template>
29
   <xsl:template name="s:d4e1">
30
      <xsl:message>test creating table of contents</xsl:message>
31
      <s:scenario label="test creating table of contents">
32
         <s:call template="tocSection"/>
33
         <xsl:variable name="actual-result" as="item()*">
34
            <xsl:call-template name="tocSection"/>
35
         </xsl:variable>
36
         <xsl:call-template name="test:report-value">
37
            <xsl:with-param name="value" select="$actual-result"/>
38
            <xsl:with-param name="wrapper-name" select="'s:result'"/>
39
            <xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
40
         </xsl:call-template>
41
         <xsl:call-template name="s:d4e3">
42
            <xsl:with-param name="actual-result" select="$actual-result"/>
43
         </xsl:call-template>
44
      </s:scenario>
45
   </xsl:template>
46
   <xsl:template name="s:d4e3">
47
      <xsl:param name="actual-result" as="item()*" required="yes"/>
48
      <xsl:message>    a divGen element should be created</xsl:message>
49
      <xsl:variable name="expected-result-doc" as="document-node()">
50
         <xsl:document>
51
            <divGen type="toc"/>
52
         </xsl:document>
53
      </xsl:variable>
54
      <xsl:variable name="expected-result" select="$expected-result-doc/node()"/>
55
      <xsl:variable name="successful" as="xs:boolean"
56
                    select="test:deep-equal($expected-result, $actual-result, 2)"/>
57
      <xsl:if test="not($successful)">
58
         <xsl:message>      FAILED</xsl:message>
59
      </xsl:if>
60
      <s:test label="a divGen element should be created" successful="{$successful}">
61
         <s:expect>
62
            <divGen type="toc"/>
63
         </s:expect>
64
      </s:test>
65
   </xsl:template>
66
</xsl:stylesheet>