admin/report-overview.xsl
branchreports
changeset 1939 ef24edf20619
parent 948 34e4ac52bc0a
equal deleted inserted replaced
1938:4ec5c316870a 1939:ef24edf20619
    25 
    25 
    26     <xsl:attribute-set name="header-cell">
    26     <xsl:attribute-set name="header-cell">
    27         <xsl:attribute name="class">header</xsl:attribute>
    27         <xsl:attribute name="class">header</xsl:attribute>
    28     </xsl:attribute-set>
    28     </xsl:attribute-set>
    29     
    29     
       
    30     <xsl:attribute-set name="xslt2">
       
    31         <xsl:attribute name="title">Tests that can be run on an XSLT 2.0 processor, but not on an XSLT 1.0 processor</xsl:attribute>
       
    32     </xsl:attribute-set>
       
    33     
       
    34     <xsl:attribute-set name="xslt3">
       
    35         <xsl:attribute name="title">Tests that can be run on an XSLT 3.0 processor, but not on an XSLT 2.0 or lower processor</xsl:attribute>
       
    36     </xsl:attribute-set>
       
    37     
       
    38     <xsl:attribute-set name="xsltany">
       
    39         <xsl:attribute name="title">Tests that can be run on an any XSLT processor</xsl:attribute>
       
    40     </xsl:attribute-set>
       
    41     
       
    42     <xsl:attribute-set name="total">
       
    43         <xsl:attribute name="title">Total tests in this category</xsl:attribute>
       
    44     </xsl:attribute-set>
       
    45     
       
    46     <xsl:attribute-set name="pass">
       
    47         <xsl:attribute name="title">Tests passed by zero/one/more processors</xsl:attribute>
       
    48     </xsl:attribute-set>
       
    49     
    30     <xsl:attribute-set name="last-header-cell" use-attribute-sets="header-cell">
    50     <xsl:attribute-set name="last-header-cell" use-attribute-sets="header-cell">
    31     </xsl:attribute-set>
    51     </xsl:attribute-set>
    32     
    52     
    33     <xsl:template match="/">
    53     <xsl:template match="/">
    34         <html>
    54         <html>
    39                         font-family: Arial, sans-serif;
    59                         font-family: Arial, sans-serif;
    40                     }
    60                     }
    41                     
    61                     
    42                     table {
    62                     table {
    43                         border: 1pt gray solid;
    63                         border: 1pt gray solid;
    44                         width: 600px;
    64                         width: 900px;
    45                     }
    65                     }
    46                     
    66                     
    47                     table * {
    67                     table * {
    48                         font-size: 10pt;
    68                         font-size: 10pt;
    49                     }
    69                     }
    50                     
    70                     
    51                     th {
    71                     th {
    52                         border: 0pt gray solid;
    72                         border: 0pt gray solid;
       
    73                         border-left: 1pt gray dotted;
    53                         padding: 3pt .8em 2pt .8em;
    74                         padding: 3pt .8em 2pt .8em;
    54                         text-align: left;
    75                         text-align: left;
    55                     }
    76                     }
    56                     
    77                     
    57                     table th.header {
    78                     table th.header {
    58                         font-size: 12pt;
    79                         font-size: 12pt;
       
    80                         text-align: right;
       
    81                         cursor: help;
       
    82                         text-decoration: underline;
       
    83                         text-decoration-style: dotted;
       
    84                         text-decoration-color: gray;
       
    85                         white-space: nowrap;
    59                     }
    86                     }
    60                     
    87                     
    61                     tr > th:first-child {
    88                     tr > th:first-child {
    62                         padding-left: 4pt;
    89                         padding-left: 4pt;
    63                     }
    90                     }
    64                     
    91                     
    65                     td {
    92                     td {
    66                         border: 0pt gray solid;
    93                         border: 0pt gray solid;
       
    94                         border-left: 1pt gray dotted;
    67                         padding: 2pt .8em 2pt .8em;
    95                         padding: 2pt .8em 2pt .8em;
    68                         text-align: right;
    96                         text-align: right;
    69                     }
    97                     }
    70 
    98 
    71                     caption {
    99                     caption {
    89     </xsl:template>
   117     </xsl:template>
    90     
   118     
    91     <xsl:template match="report/overview">
   119     <xsl:template match="report/overview">
    92         <tr>
   120         <tr>
    93             <th xsl:use-attribute-sets="header-cell">&#xA;</th>
   121             <th xsl:use-attribute-sets="header-cell">&#xA;</th>
    94             <th xsl:use-attribute-sets="header-cell">XSLT 2.0</th>
   122             <th xsl:use-attribute-sets="header-cell xslt2">XSLT 2.0</th>
    95             <th xsl:use-attribute-sets="header-cell">XSLT 3.0</th>
   123             <th xsl:use-attribute-sets="header-cell xslt3">XSLT 3.0</th>
    96             <th xsl:use-attribute-sets="header-cell">Unclassified / other</th>
   124             <th xsl:use-attribute-sets="header-cell xsltany">Other</th>
    97             <th xsl:use-attribute-sets="last-header-cell">Total</th>
   125             <th xsl:use-attribute-sets="header-cell total">Total</th>
    98         </tr>
   126             <th xsl:use-attribute-sets="header-cell pass">Pass rate</th>
    99         <tr>
   127         </tr>
   100             <th xsl:use-attribute-sets="first-cell">All categories</th>
   128         <tr>
   101             <td xsl:use-attribute-sets="cell">{xslt2-specific/@count}</td>
   129             <th xsl:use-attribute-sets="first-cell">All categories<br />&#xA0;</th>
   102             <td xsl:use-attribute-sets="cell">{xslt3-specific/@count}</td>
   130             <td xsl:use-attribute-sets="cell">{xslt2-specific/@count}</td>
   103             <td xsl:use-attribute-sets="cell">{xslt-other/@count}</td>
   131             <td xsl:use-attribute-sets="cell">{xslt3-specific/@count}</td>
   104             <td xsl:use-attribute-sets="last-cell">{@total-tests-in-xt3}</td>
   132             <td xsl:use-attribute-sets="cell">{xslt-other/@count}</td>
       
   133             <td xsl:use-attribute-sets="cell">{@total-tests-in-xt3}</td>
       
   134             <td xsl:use-attribute-sets="last-cell"><span style="color:red">{@total-tests-in-xt3 - pass1/@count - pass2/@count}</span>/{pass1/@count}/{pass2/@count}</td>
   105         </tr>
   135         </tr>
   106         <xsl:apply-templates select="../category/overview" />
   136         <xsl:apply-templates select="../category/overview" />
   107     </xsl:template>
   137     </xsl:template>
   108     
   138     
   109     <xsl:template match="category/overview">
   139     <xsl:template match="category/overview">
       
   140         <!-- totals in the very first "overview by category" -->
   110         <tr>
   141         <tr>
   111             <th xsl:use-attribute-sets="first-cell">
   142             <th xsl:use-attribute-sets="first-cell">
   112                 <a href="#{encode-for-uri(parent::category/@name)}-xt3">{parent::category/@name}</a>
   143                 <a href="#{encode-for-uri(parent::category/@name)}-xt3">{parent::category/@name}</a>
   113             </th>
   144             </th>
   114             <td xsl:use-attribute-sets="cell">{xslt2-specific/@count}</td>
   145             <td xsl:use-attribute-sets="cell">{xslt2-specific/@count}</td>
   115             <td xsl:use-attribute-sets="cell">{xslt3-specific/@count}</td>
   146             <td xsl:use-attribute-sets="cell">{xslt3-specific/@count}</td>
   116             <td xsl:use-attribute-sets="cell">{xslt-other/@count}</td>
   147             <td xsl:use-attribute-sets="cell">{xslt-other/@count}</td>
   117             <td xsl:use-attribute-sets="last-cell">{@total-tests-in-category}</td>
   148             <td xsl:use-attribute-sets="cell">{@total-tests-in-category}</td>
       
   149             <td xsl:use-attribute-sets="last-cell"><span style="color:red">{@total-tests-in-category - pass1/@count - pass2/@count}</span>/{pass1/@count}/{pass2/@count}</td>
   118         </tr>
   150         </tr>
   119     </xsl:template>
   151     </xsl:template>
   120     
   152     
   121     <xsl:template match="report/category">
   153     <xsl:template match="report/category">
       
   154         <!-- caption-then-report per category, as clicked-through from the opening table -->
   122         <table>
   155         <table>
   123             <caption><a id="{encode-for-uri(@name)}-xt3" />{@name} (XT3)</caption>
   156             <caption><a id="{encode-for-uri(@name)}-xt3" />{@name} (XT3)</caption>
       
   157             
       
   158             <tr>
       
   159               <th xsl:use-attribute-sets="header-cell">&#xA0;</th>
       
   160               <th xsl:use-attribute-sets="header-cell xslt2">XSLT 2.0</th>
       
   161               <th xsl:use-attribute-sets="header-cell xslt3">XSLT 3.0</th>
       
   162               <th xsl:use-attribute-sets="header-cell xsltany">Other</th>
       
   163               <th xsl:use-attribute-sets="header-cell total">Total</th>
       
   164               <th xsl:use-attribute-sets="last-header-cell pass">Pass rate</th>
       
   165             </tr>
       
   166             
       
   167             <!-- first row per category -->
   124             <xsl:apply-templates select="overview" mode="cat-overview" />
   168             <xsl:apply-templates select="overview" mode="cat-overview" />
       
   169             
       
   170             <!-- other rows, to be clicked-through further down -->
   125             <xsl:apply-templates select="test-set" />
   171             <xsl:apply-templates select="test-set" />
   126         </table>
   172         </table>
   127     </xsl:template>
   173     </xsl:template>
   128 
   174 
   129     <xsl:template match="category/overview" mode="cat-overview">
   175     <xsl:template match="category/overview" mode="cat-overview">
       
   176         <!-- totals per category, as clicked-through from the opening table, this is the first row -->
   130         <tr>
   177         <tr>
   131             <th xsl:use-attribute-sets="first-cell">{parent::category/@name} (all)</th>
   178             <th xsl:use-attribute-sets="first-cell">{parent::category/@name} (all)</th>
   132             <td xsl:use-attribute-sets="cell">{xslt2-specific/@count}</td>
   179             <td xsl:use-attribute-sets="cell">{xslt2-specific/@count}</td>
   133             <td xsl:use-attribute-sets="cell">{xslt3-specific/@count}</td>
   180             <td xsl:use-attribute-sets="cell">{xslt3-specific/@count}</td>
   134             <td xsl:use-attribute-sets="cell">{xslt-other/@count}</td>
   181             <td xsl:use-attribute-sets="cell">{xslt-other/@count}</td>
   135             <td xsl:use-attribute-sets="last-cell">{@total-tests-in-category}</td>
   182             <td xsl:use-attribute-sets="cell">{@total-tests-in-category}</td>
       
   183             <td xsl:use-attribute-sets="last-cell"><span style="color:red">{@total-tests-in-category - pass1/@count - pass2/@count}</span>/{pass1/@count}/{pass2/@count}</td>
   136         </tr>
   184         </tr>
   137     </xsl:template>
   185     </xsl:template>
   138 
   186 
   139     <xsl:template match="category/test-set">
   187     <xsl:template match="category/test-set">
   140         <tr>
   188         <tr>
   142                 <a href="#{encode-for-uri(@description)}-keywords">{@description}</a>
   190                 <a href="#{encode-for-uri(@description)}-keywords">{@description}</a>
   143             </th>
   191             </th>
   144             <td xsl:use-attribute-sets="cell">{xslt2-specific/@count}</td>
   192             <td xsl:use-attribute-sets="cell">{xslt2-specific/@count}</td>
   145             <td xsl:use-attribute-sets="cell">{xslt3-specific/@count}</td>
   193             <td xsl:use-attribute-sets="cell">{xslt3-specific/@count}</td>
   146             <td xsl:use-attribute-sets="cell">{xslt-other/@count}</td>
   194             <td xsl:use-attribute-sets="cell">{xslt-other/@count}</td>
   147             <td xsl:use-attribute-sets="last-cell">{@total-tests}</td>
   195             <td xsl:use-attribute-sets="cell">{@total-tests}</td>
       
   196             <td xsl:use-attribute-sets="last-cell"><span style="color:red">{@total-tests - pass1/@count - pass2/@count}</span>/{pass1/@count}/{pass2/@count}</td>
   148         </tr>
   197         </tr>
   149     </xsl:template>
   198     </xsl:template>
   150     
   199     
   151 
   200 
   152     <xsl:template match="changes-since-xslt2">
   201     <xsl:template match="changes-since-xslt2">
   154             <caption>Overview by 3.0 feature</caption>
   203             <caption>Overview by 3.0 feature</caption>
   155     
   204     
   156             <tr>
   205             <tr>
   157                 <th xsl:use-attribute-sets="header-cell">&#xA;</th>
   206                 <th xsl:use-attribute-sets="header-cell">&#xA;</th>
   158                 <th xsl:use-attribute-sets="header-cell">Total</th>
   207                 <th xsl:use-attribute-sets="header-cell">Total</th>
       
   208                 <th xsl:use-attribute-sets="header-cell pass">Pass rate</th>
   159             </tr>
   209             </tr>
   160             <tr>
   210             <tr>
   161                 <th xsl:use-attribute-sets="first-cell">All features</th>
   211                 <th xsl:use-attribute-sets="first-cell">All features</th>
   162                 <td xsl:use-attribute-sets="cell">{sum(feature/@count[not(contains(., 'unknown'))])}</td>
   212                 <td xsl:use-attribute-sets="cell">{sum(feature/@count[not(contains(., 'unknown'))])}</td>
       
   213                 <td xsl:use-attribute-sets="cell">{sum(feature[@count != 'unknown']/@pass1)}/{sum(feature[@count != 'unknown']/@pass2)}</td>
   163             </tr>
   214             </tr>
   164             <xsl:for-each-group select="feature" group-adjacent="@group">
   215             <xsl:for-each-group select="feature" group-adjacent="@group">
   165                 <tr>
   216                 <tr>
   166                     <th xsl:use-attribute-sets="first-cell">
   217                     <th xsl:use-attribute-sets="first-cell">
   167                         <a href="#{encode-for-uri(current-grouping-key())}">{current-grouping-key()}</a>
   218                         <a href="#{encode-for-uri(current-grouping-key())}">{current-grouping-key()}</a>