ottlinger commented on code in PR #405:
URL: https://github.com/apache/creadur-rat/pull/405#discussion_r1868999868


##########
apache-rat-core/src/main/resources/org/apache/rat/plain-rat.xsl:
##########
@@ -19,59 +19,94 @@
 -->
 <xsl:stylesheet version="1.0"
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
-    <xsl:variable name='newline'><xsl:text>&#xa;</xsl:text></xsl:variable>
-
-<xsl:output method='text'/>
-<xsl:template match='/'>
-*****************************************************
-Summary
-*****************************************************
-Generated at: <xsl:value-of select='rat-report/@timestamp'/>
-
-Counters:
-    <xsl:for-each select='descendant::statistic'>
-            <xsl:value-of select='concat($newline, substring(concat(@name, ":  
                "), 1, 20),
-            @count)' />
-            <xsl:if test='@approval="false"'> (Exceeded limits)</xsl:if>
-            <xsl:value-of select='concat("    ", @description)' />
-    </xsl:for-each>
-
-
-Licenses detected:
-    <xsl:for-each select='descendant::licenseName'>
-    <xsl:value-of select='concat($newline, @name, ": ", @count, " ")' />
-    </xsl:for-each>
-
-License Categories detected:
-    <xsl:for-each select='descendant::licenseCategory'>
-        <xsl:value-of select='concat($newline, @name, ": ", @count, " ")' />
-    </xsl:for-each>
-
-Document Types detected:
-    <xsl:for-each select='descendant::documentType'>
-        <xsl:value-of select='concat($newline, @name, ": ", @count, " ")' />
-    </xsl:for-each>
-
-<xsl:if test="descendant::resource[license/@approval='false']">
-
-*****************************************************
-
-Files with unapproved licenses:
-
-<xsl:for-each select='descendant::resource[license/@approval="false"]'>
-  <xsl:value-of select='concat("  ",@name, $newline)'/>
-</xsl:for-each>
-*****************************************************
-</xsl:if>
-<xsl:if test="descendant::resource[@type='ARCHIVE']">
-Archives:
-<xsl:for-each select='descendant::resource[@type="ARCHIVE"]'>
-  <xsl:value-of select='concat(" ", @name, $newline)'/>
-</xsl:for-each>
-</xsl:if>
-<xsl:text>
-*****************************************************
-  Documents with unapproved licenses will start with a '!'
+    <xsl:variable name='newline'>
+        <xsl:text>&#xa;</xsl:text>
+    </xsl:variable>
+    <xsl:variable name="sectionPartition">
+        
<xsl:text>*****************************************************</xsl:text>
+    </xsl:variable>
+    <xsl:variable name="subsectionPartition">
+        
<xsl:text>-----------------------------------------------------</xsl:text>
+    </xsl:variable>
+
+    <xsl:output method='text'/>
+    <xsl:template match='/'>
+        <xsl:call-template name="section">
+            <xsl:with-param name="title">Summary</xsl:with-param>
+        </xsl:call-template>
+        <xsl:value-of select='concat("Generated at: ", rat-report/@timestamp, 
$newline, "    by ",
+    rat-report/version/@product, " ", rat-report/version/@version, " (", 
rat-report/version/@vendor, ")")'/>
+
+        <xsl:call-template name="subsection">
+            <xsl:with-param name="title">Counters</xsl:with-param>
+        </xsl:call-template>
+
+        <xsl:text>    (Entries starting with '!' exceed the minimum or maximum 
values)</xsl:text>
+        <xsl:value-of select='$newline'/>
+        <xsl:for-each select='descendant::statistic'>
+            <xsl:call-template name="statistic">
+                <xsl:with-param name="name"><xsl:value-of 
select="@name"/></xsl:with-param>
+                <xsl:with-param name="count"><xsl:value-of 
select="@count"/></xsl:with-param>
+                <xsl:with-param name="description"><xsl:value-of 
select="@description"/></xsl:with-param>
+                <xsl:with-param name="leadin"><xsl:choose>
+                    <xsl:when test='@approval="false"'><xsl:text>! 
</xsl:text></xsl:when>
+                    <xsl:otherwise><xsl:text>  </xsl:text></xsl:otherwise>
+                </xsl:choose></xsl:with-param>
+            </xsl:call-template>
+        </xsl:for-each>
+
+        <xsl:call-template name="subsection">
+            <xsl:with-param name="title">Licenses detected</xsl:with-param>
+        </xsl:call-template>
+
+        <xsl:for-each select='descendant::licenseName'>
+            <xsl:value-of select='concat($newline, @name, ": ", @count, " ")'/>
+        </xsl:for-each>
+
+        <xsl:call-template name="subsection">
+            <xsl:with-param name="title">License Categories 
detected</xsl:with-param>
+        </xsl:call-template>
+
+        <xsl:for-each select='descendant::licenseCategory'>
+            <xsl:value-of select='concat($newline, @name, ": ", @count, " ")'/>
+        </xsl:for-each>
+
+        <xsl:call-template name="subsection">
+            <xsl:with-param name="title">Document Types 
detected</xsl:with-param>
+        </xsl:call-template>
+
+        <xsl:for-each select='descendant::documentType'>
+            <xsl:value-of select='concat($newline, @name, ": ", @count, " ")'/>
+        </xsl:for-each>
+
+        <xsl:if test="descendant::resource[license/@approval='false']">
+            <xsl:value-of select="concat($newline, $newline)" />
+            <xsl:call-template name="section">
+                <xsl:with-param name="title">Files with unapproved 
licenses</xsl:with-param>
+            </xsl:call-template>
+
+            <xsl:for-each 
select='descendant::resource[license/@approval="false"]'>
+                <xsl:value-of select='concat($newline, "  ", @name)'/>
+            </xsl:for-each>
+
+        </xsl:if>
+
+        <xsl:if test="descendant::resource[@type='ARCHIVE']">
+            <xsl:value-of select="concat($newline, $newline)" />
+            <xsl:call-template name="section">
+                <xsl:with-param name="title">Archives</xsl:with-param>
+            </xsl:call-template>
+
+            <xsl:for-each select='descendant::resource[@type="ARCHIVE"]'>
+                <xsl:value-of select='concat($newline, " ", @name)'/>
+            </xsl:for-each>
+        </xsl:if>
+        <xsl:value-of select="concat($newline, $newline)" />
+        <xsl:call-template name="section">
+            <xsl:with-param name="title">Detail</xsl:with-param>
+        </xsl:call-template>
+        <xsl:text>
+  The line following documents with unapproved licenses will start with a '!'

Review Comment:
   There seems to be a misunderstaning - I only had the feeling that the 
sentence in the report itself can be simplified to be more concise/clearer. 
Nothing more - no functional change or change in the report functionality.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@creadur.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to