13d781bd6SAndre Fischer<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
23d781bd6SAndre Fischer
3*c9f0b576SAndre Fischer<!--***********************************************************
4*c9f0b576SAndre Fischer *
5*c9f0b576SAndre Fischer * Licensed to the Apache Software Foundation (ASF) under one
6*c9f0b576SAndre Fischer * or more contributor license agreements.  See the NOTICE file
7*c9f0b576SAndre Fischer * distributed with this work for additional information
8*c9f0b576SAndre Fischer * regarding copyright ownership.  The ASF licenses this file
9*c9f0b576SAndre Fischer * to you under the Apache License, Version 2.0 (the
10*c9f0b576SAndre Fischer * "License"); you may not use this file except in compliance
11*c9f0b576SAndre Fischer * with the License.  You may obtain a copy of the License at
12*c9f0b576SAndre Fischer *
13*c9f0b576SAndre Fischer *   http://www.apache.org/licenses/LICENSE-2.0
14*c9f0b576SAndre Fischer *
15*c9f0b576SAndre Fischer * Unless required by applicable law or agreed to in writing,
16*c9f0b576SAndre Fischer * software distributed under the License is distributed on an
17*c9f0b576SAndre Fischer * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18*c9f0b576SAndre Fischer * KIND, either express or implied.  See the License for the
19*c9f0b576SAndre Fischer * specific language governing permissions and limitations
20*c9f0b576SAndre Fischer * under the License.
21*c9f0b576SAndre Fischer *
22*c9f0b576SAndre Fischer ***********************************************************-->
23*c9f0b576SAndre Fischer
243d781bd6SAndre Fischer<!-- This style sheet converts any rat-report.xml file.  -->
253d781bd6SAndre Fischer
263d781bd6SAndre Fischer<xsl:variable name="now" select="current-dateTime()"/>
273d781bd6SAndre Fischer
283d781bd6SAndre Fischer<xsl:template match="/">
293d781bd6SAndre Fischer
303d781bd6SAndre Fischer    <html>
313d781bd6SAndre Fischer
323d781bd6SAndre Fischer    <xsl:comment>Generated at <xsl:value-of select="$now"/></xsl:comment>
333d781bd6SAndre Fischer    <head>
343d781bd6SAndre Fischer     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
353d781bd6SAndre Fischer     <style type="text/css">
363d781bd6SAndre Fischer    &lt;!--
373d781bd6SAndre Fischerbody {margin-top: 0px;font-size: 0.8em;background-color: #F9F7ED;}
383d781bd6SAndre Fischer
393d781bd6SAndre Fischerh1 {color:red;}
403d781bd6SAndre Fischerh2 {color:blue;}
413d781bd6SAndre Fischerh3 {color:green;}
423d781bd6SAndre Fischerh4 {color:orange;}
433d781bd6SAndre Fischer
443d781bd6SAndre Fischer/* Table Design */
453d781bd6SAndre Fischer
463d781bd6SAndre Fischertable,tr,td {text-align:center;font-weight:bold;border:1px solid #000;}
473d781bd6SAndre Fischercaption {color:blue;text-align:left;}
483d781bd6SAndre Fischer.notes, .binaries, .archives, .standards {width:25%;}
493d781bd6SAndre Fischer.notes {background:#D7EDEE;}
503d781bd6SAndre Fischer.binaries {background:#D0F2F4;}
513d781bd6SAndre Fischer.archives {background:#ABE7E9;}
523d781bd6SAndre Fischer.standards {background:#A0F0F4;}
533d781bd6SAndre Fischer.licenced, .generated {width:50%;}
543d781bd6SAndre Fischer.licenced {background:#C6EBDD;}
553d781bd6SAndre Fischer.generated {background:#ABE9D2;}
563d781bd6SAndre Fischer.java_note {background:#D6EBC6;}
573d781bd6SAndre Fischer.generated_note {background:#C9E7A9;}
583d781bd6SAndre Fischer.unknown {width:100%;background:#E92020;}
593d781bd6SAndre Fischer.unknown-zero {color:#00CC00;}
603d781bd6SAndre Fischer.center{text-align:center;margin:0 auto;}
613d781bd6SAndre Fischer--&gt;
623d781bd6SAndre Fischer     </style>
633d781bd6SAndre Fischer    </head>
643d781bd6SAndre Fischer    <body>
653d781bd6SAndre Fischer	    <xsl:apply-templates/>
663d781bd6SAndre Fischer	    <xsl:call-template name="generated"/>
673d781bd6SAndre Fischer    </body>
683d781bd6SAndre Fischer    </html>
693d781bd6SAndre Fischer</xsl:template>
703d781bd6SAndre Fischer
713d781bd6SAndre Fischer<xsl:template match="rat-report">
723d781bd6SAndre Fischer
733d781bd6SAndre Fischer	<h1>Rat Report</h1>
743d781bd6SAndre Fischer	<p>This HTML version (yes, it is!) is generated from the RAT xml reports using Saxon9B. All the outputs required are displayed below, similar to the .txt version.
753d781bd6SAndre Fischer           This is obviously a work in progress; and a prettier, easier to read and manage version will be available soon</p>
763d781bd6SAndre Fischer<div class="center">
773d781bd6SAndre Fischer<table id="rat-reports summary" cellspacing="0" summary="A snapshot summary of this rat report">
783d781bd6SAndre Fischer<caption>
793d781bd6SAndre FischerTable 1: A snapshot summary of this rat report.
803d781bd6SAndre Fischer</caption>
813d781bd6SAndre Fischer  <tr>
823d781bd6SAndre Fischer    <td colspan="1" class="notes">Notes: <xsl:value-of select="count(descendant::type[attribute::name=&quot;notice&quot;])"/></td>
833d781bd6SAndre Fischer    <td colspan="1" class="binaries">Binaries: <xsl:value-of select="count(descendant::type[attribute::name=&quot;binary&quot;])"/></td>
843d781bd6SAndre Fischer    <td colspan="1" class="archives">Archives: <xsl:value-of select="count(descendant::type[attribute::name=&quot;archive&quot;])"/></td>
853d781bd6SAndre Fischer    <td colspan="1" class="standards">Standards: <xsl:value-of select="count(descendant::type[attribute::name=&quot;standard&quot;])"/></td>
863d781bd6SAndre Fischer  </tr>
873d781bd6SAndre Fischer  <tr>
883d781bd6SAndre Fischer    <td colspan="2" class="licenced">Apache Licensed: <xsl:value-of select="count(descendant::header-type[attribute::name=&quot;AL   &quot;])"/></td>
893d781bd6SAndre Fischer    <td colspan="2" class="generated">Generated Documents: <xsl:value-of select="count(descendant::header-type[attribute::name=&quot;GEN  &quot;])"/></td>
903d781bd6SAndre Fischer  </tr>
913d781bd6SAndre Fischer  <tr>
923d781bd6SAndre Fischer    <td colspan="2" class="java_note">Note: JavaDocs are generated and so license header is optional</td>
933d781bd6SAndre Fischer    <td colspan="2" class="generated_note">Note: Generated files do not require license headers</td>
943d781bd6SAndre Fischer  </tr>
953d781bd6SAndre Fischer  <tr>
963d781bd6SAndre Fischer<xsl:choose>
973d781bd6SAndre Fischer  <xsl:when test="count(descendant::header-type[attribute::name=&quot;?????&quot;]) &gt; 0">
983d781bd6SAndre Fischer    <td colspan="4" class="unknown"><xsl:value-of select="count(descendant::header-type[attribute::name=&quot;?????&quot;])"/> Unknown Licenses - or files without a license.</td>
993d781bd6SAndre Fischer  </xsl:when>
1003d781bd6SAndre Fischer  <xsl:otherwise>
1013d781bd6SAndre Fischer    <td colspan="4" class="unknown-zero"><xsl:value-of select="count(descendant::header-type[attribute::name=&quot;?????&quot;])"/> Unknown Licenses - or files without a license.</td>
1023d781bd6SAndre Fischer  </xsl:otherwise>
1033d781bd6SAndre Fischer</xsl:choose>
1043d781bd6SAndre Fischer  </tr>
1053d781bd6SAndre Fischer</table>
1063d781bd6SAndre Fischer</div>
1073d781bd6SAndre Fischer<hr/>
1083d781bd6SAndre Fischer	<h3>Unapproved Licenses:</h3>
1093d781bd6SAndre Fischer
1103d781bd6SAndre Fischer	<xsl:for-each select="descendant::resource[license-approval/@name=&quot;false&quot;]">
1113d781bd6SAndre Fischer  <xsl:text>  </xsl:text>
1123d781bd6SAndre Fischer  <xsl:value-of select="@name"/><br/>
1133d781bd6SAndre Fischer  <xsl:text>
1143d781bd6SAndre Fischer</xsl:text>
1153d781bd6SAndre Fischer</xsl:for-each>
1163d781bd6SAndre Fischer<hr/>
1173d781bd6SAndre Fischer
1183d781bd6SAndre Fischer<h3>Archives:</h3>
1193d781bd6SAndre Fischer
1203d781bd6SAndre Fischer<xsl:for-each select="descendant::resource[type/@name=&quot;archive&quot;]">
1213d781bd6SAndre Fischer + <xsl:value-of select="@name"/>
1223d781bd6SAndre Fischer <br/>
1233d781bd6SAndre Fischer </xsl:for-each>
1243d781bd6SAndre Fischer <hr/>
1253d781bd6SAndre Fischer
1263d781bd6SAndre Fischer <p>
1273d781bd6SAndre Fischer	 Files with Apache License headers will be marked AL<br/>
1283d781bd6SAndre Fischer	 Binary files (which do not require AL headers) will be marked B<br/>
1293d781bd6SAndre Fischer  Compressed archives will be marked A<br/>
1303d781bd6SAndre Fischer  Notices, licenses etc will be marked N<br/>
1313d781bd6SAndre Fischer  </p>
1323d781bd6SAndre Fischer
1333d781bd6SAndre Fischer <xsl:for-each select="descendant::resource">
1343d781bd6SAndre Fischer  <xsl:choose>
1353d781bd6SAndre Fischer	 <xsl:when test="license-approval/@name=&quot;false&quot;">!</xsl:when>
1363d781bd6SAndre Fischer	 <xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
1373d781bd6SAndre Fischer </xsl:choose>
1383d781bd6SAndre Fischer <xsl:choose>
1393d781bd6SAndre Fischer	 <xsl:when test="type/@name=&quot;notice&quot;">N   </xsl:when>
1403d781bd6SAndre Fischer	 <xsl:when test="type/@name=&quot;archive&quot;">A   </xsl:when>
1413d781bd6SAndre Fischer	 <xsl:when test="type/@name=&quot;binary&quot;">B   </xsl:when>
1423d781bd6SAndre Fischer	 <xsl:when test="type/@name=&quot;standard&quot;"><xsl:value-of select="header-type/@name"/></xsl:when>
1433d781bd6SAndre Fischer	 <xsl:otherwise>!!!!!</xsl:otherwise>
1443d781bd6SAndre Fischer </xsl:choose>
1453d781bd6SAndre Fischer <xsl:text>      </xsl:text>
1463d781bd6SAndre Fischer <xsl:value-of select="@name"/><br/>
1473d781bd6SAndre Fischer <xsl:text>
1483d781bd6SAndre Fischer </xsl:text>
1493d781bd6SAndre Fischer </xsl:for-each>
1503d781bd6SAndre Fischer <hr/>
1513d781bd6SAndre Fischer
1523d781bd6SAndre Fischer <h3>Printing headers for files without AL header...</h3>
1533d781bd6SAndre Fischer
1543d781bd6SAndre Fischer <xsl:for-each select="descendant::resource[header-type/@name=&quot;?????&quot;]">
1553d781bd6SAndre Fischer
1563d781bd6SAndre Fischer	 <h4><xsl:value-of select="@name"/></h4>
1573d781bd6SAndre Fischer  <xsl:value-of select="header-sample"/>
1583d781bd6SAndre Fischer  <hr/>
1593d781bd6SAndre Fischer</xsl:for-each>
1603d781bd6SAndre Fischer<br/>
1613d781bd6SAndre Fischer
1623d781bd6SAndre Fischer <!-- <xsl:apply-templates select="resource"/>
1633d781bd6SAndre Fischer    <xsl:apply-templates select="header-sample"/>
1643d781bd6SAndre Fischer    <xsl:apply-templates select="header-type"/>
1653d781bd6SAndre Fischer    <xsl:apply-templates select="license-family"/>
1663d781bd6SAndre Fischer    <xsl:apply-templates select="license-approval"/>
1673d781bd6SAndre Fischer    <xsl:apply-templates select="type"/> -->
1683d781bd6SAndre Fischer
1693d781bd6SAndre Fischer</xsl:template>
1703d781bd6SAndre Fischer
1713d781bd6SAndre Fischer<xsl:template match="resource">
1723d781bd6SAndre Fischer	<div>
1733d781bd6SAndre Fischer		<h3>Resource: <xsl:value-of select="@name"/></h3>
1743d781bd6SAndre Fischer      <xsl:apply-templates/>
1753d781bd6SAndre Fischer    </div>
1763d781bd6SAndre Fischer</xsl:template>
1773d781bd6SAndre Fischer
1783d781bd6SAndre Fischer<xsl:template match="header-sample">
1793d781bd6SAndre Fischer	<xsl:if test="normalize-space(.) != ''">
1803d781bd6SAndre Fischer  <h4>First few lines of non-compliant file</h4>
1813d781bd6SAndre Fischer    <p>
1823d781bd6SAndre Fischer      <xsl:value-of select="."/>
1833d781bd6SAndre Fischer    </p>
1843d781bd6SAndre Fischer    </xsl:if>
1853d781bd6SAndre Fischer    <h4>Other Info:</h4>
1863d781bd6SAndre Fischer</xsl:template>
1873d781bd6SAndre Fischer
1883d781bd6SAndre Fischer<xsl:template match="header-type">
1893d781bd6SAndre Fischer	Header Type: <xsl:value-of select="@name"/>
1903d781bd6SAndre Fischer	<br/>
1913d781bd6SAndre Fischer</xsl:template>
1923d781bd6SAndre Fischer
1933d781bd6SAndre Fischer<xsl:template match="license-family">
1943d781bd6SAndre Fischer	License Family: <xsl:value-of select="@name"/>
1953d781bd6SAndre Fischer	<br/>
1963d781bd6SAndre Fischer</xsl:template>
1973d781bd6SAndre Fischer
1983d781bd6SAndre Fischer<xsl:template match="license-approval">
1993d781bd6SAndre Fischer	License Approval: <xsl:value-of select="@name"/>
2003d781bd6SAndre Fischer	<br/>
2013d781bd6SAndre Fischer</xsl:template>
2023d781bd6SAndre Fischer
2033d781bd6SAndre Fischer<xsl:template match="type">
2043d781bd6SAndre Fischer	Type: <xsl:value-of select="@name"/>
2053d781bd6SAndre Fischer	<br/>
2063d781bd6SAndre Fischer</xsl:template>
2073d781bd6SAndre Fischer
2083d781bd6SAndre Fischer<xsl:template name="generated">
2093d781bd6SAndre Fischer	<p>Generated at <xsl:value-of select="$now"/></p>
2103d781bd6SAndre Fischer</xsl:template>
2113d781bd6SAndre Fischer</xsl:transform>