tests/attr/validation/validation-0213.xsl
author Michael Kay <mike@saxonica.com>
Tue, 05 Dec 2017 23:11:06 +0000
changeset 1789 7fe5dce7e15e
permissions -rw-r--r--
Test validation of xsl:result-document with item-separator
1789
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     1
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     2
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     3
    xmlns="http://www.w3.org/1999/xhtml"
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     4
    exclude-result-prefixes="xs"
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     5
    version="2.0">
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     6
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     7
    <!-- xsl:result-document validation: no href; valid -->
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     8
    
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     9
    <xsl:output method="xhtml" indent="yes"/>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    10
    
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    11
    <!-- import the schema for the target XHTML vocabulary -->
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    12
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    13
  <xsl:import-schema namespace="http://www.w3.org/1999/xhtml"
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    14
    schema-location="xhtml1-transitional.xsd"/>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    15
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    16
    <xsl:param name="dir" select="'.'"/>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    17
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    18
    <xsl:template match="/">
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    19
        <xsl:result-document validation="strict">
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    20
            <xsl:call-template name="make-index"/>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    21
        </xsl:result-document>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    22
    </xsl:template>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    23
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    24
    <xsl:template name="make-index">
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    25
        <xsl:comment>The start</xsl:comment>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    26
        <html>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    27
            <head>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    28
                <title>Index of names</title>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    29
            </head>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    30
            <body>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    31
                <h1>Index of names</h1>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    32
                <xsl:for-each-group select="/*/IndividualRec/IndivName/NamePart[@Level=1]"
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    33
                    group-by=".">
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    34
                    <xsl:sort select="current-grouping-key()"/>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    35
                    <h2>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    36
                        <xsl:value-of select="current-grouping-key()"/>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    37
                    </h2>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    38
                    <xsl:for-each select="current-group()">
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    39
                        <p>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    40
                            <xsl:value-of select="ancestor::IndividualRec/IndivName[1]"/>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    41
                        </p>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    42
                    </xsl:for-each>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    43
                </xsl:for-each-group>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    44
            </body>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    45
            <xsl:if test="current-date() lt xs:date('1900-01-01')">
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    46
              <body>Two bodies is bad news</body>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    47
            </xsl:if>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    48
        </html>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    49
        <xsl:comment>The end</xsl:comment>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    50
    </xsl:template>
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    51
7fe5dce7e15e Test validation of xsl:result-document with item-separator
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    52
</xsl:transform>