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