You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by rd...@apache.org on 2008/06/30 20:29:21 UTC
svn commit: r672856 - in /incubator/rat/main/trunk/scan: build.xml
src/main/org/apache/rat/scan/summary-txt.xsl
src/main/org/apache/rat/scan/tests.py
Author: rdonkin
Date: Mon Jun 30 11:29:20 2008
New Revision: 672856
URL: http://svn.apache.org/viewvc?rev=672856&view=rev
Log:
Update text stylesheet to use xhtml
Modified:
incubator/rat/main/trunk/scan/build.xml
incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/summary-txt.xsl
incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/tests.py
Modified: incubator/rat/main/trunk/scan/build.xml
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/scan/build.xml?rev=672856&r1=672855&r2=672856&view=diff
==============================================================================
--- incubator/rat/main/trunk/scan/build.xml (original)
+++ incubator/rat/main/trunk/scan/build.xml Mon Jun 30 11:29:20 2008
@@ -14,6 +14,13 @@
-->
<project name="RAT Scan build" default="dist" xmlns:rat='antlib:org.apache.rat.scan'>
+ <target name='xsl'>
+ <property name='src.rat' location='src/main'/>
+ <xslt
+ style="${src.rat}/org/apache/rat/scan/summary-txt.xsl"
+ in='${src.rat}/org/apache/rat/scan/diff.html'
+ out='summary.xml'></xslt>
+ </target>
<target name='run'>
Modified: incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/summary-txt.xsl
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/summary-txt.xsl?rev=672856&r1=672855&r2=672856&view=diff
==============================================================================
--- incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/summary-txt.xsl (original)
+++ incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/summary-txt.xsl Mon Jun 30 11:29:20 2008
@@ -13,19 +13,34 @@
limitations under the License.
-->
<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method='text' encoding='iso-8859-1' />
-
- <xsl:template match='changes'>
-Audit Report: <xsl:value-of select='@from' /> -> <xsl:value-of select='@to' />
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:html="http://www.w3.org/1999/xhtml"><xsl:output method='text' encoding='iso-8859-1' /><xsl:template match='/'>
+Audit Report: <xsl:value-of select='//html:a[@class="start-date"]' /> -> <xsl:value-of select='//html:a[@class="end-date"]' />
======================================
-<xsl:choose>
- <xsl:when test='count(descendant::added/document) + count(descendant::modified/document) + count(descendant::missing/document) > 0 '>
- * <xsl:value-of select='count(descendant::added/document)'/> files were added
- * <xsl:value-of select='count(descendant::modified/document)'/> files were modified
- * <xsl:value-of select='count(descendant::missing/document)'/> files were deleted
-
-For details see http://incubator.apache.org/audit/changes-<xsl:value-of select='@to' />.html
+<xsl:choose><xsl:when test='count(//html:ul[@class="added"]//html:li[@class="resource"]) + count(//html:ul[@class="modified"]//html:li[@class="resource"]) + count(//html:ul[@class="deleted"]//html:li[@class="resource"]) > 0 '>
+ * <xsl:value-of select='count(//html:ul[@class="added"]//html:li[@class="resource"])'/> files were added
+ * <xsl:value-of select='count(//html:ul[@class="modified"]//html:li[@class="resource"])'/> files were modified
+ * <xsl:value-of select='count(//html:ul[@class="deleted"]//html:li[@class="resource"])'/> files were deleted
+<xsl:if test='count(//html:ul[@class="modified"]//html:li[@class="resource"])'>
+Modified
+--------<xsl:for-each select='//html:ul[@class="modified"]/html:li[@class="dir"]'><xsl:if test='count(.//html:li[@class="resource"])'>
+In <xsl:value-of select="text()"/>:<xsl:for-each select='.//html:li[@class="resource"]'><xsl:sort select="text()" data-type = "text" order = "ascending" case-order = "lower-first"/>
+ * <xsl:value-of select="text()"/>
+</xsl:for-each></xsl:if></xsl:for-each></xsl:if>
+<xsl:if test='count(//html:ul[@class="added"]//html:li[@class="resource"])'>
+
+Added
+-----<xsl:for-each select='.//html:ul[@class="added"]/html:li[@class="dir"]'><xsl:if test='count(.//html:li[@class="resource"])'>
+In <xsl:value-of select="text()"/>:<xsl:for-each select='.//html:li[@class="resource"]'><xsl:sort select="text()" data-type = "text" order = "ascending" case-order = "lower-first"/>
+ * <xsl:value-of select="text()"/>
+</xsl:for-each></xsl:if></xsl:for-each></xsl:if>
+<xsl:if test='count(//html:ul[@class="deleted"]//html:li[@class="resource"])'>
+
+Deleted
+-------<xsl:for-each select='.//html:ul[@class="deleted"]/html:li[@class="dir"]'><xsl:if test='count(.//html:li[@class="resource"])'>
+In <xsl:value-of select="text()"/>:<xsl:for-each select='.//html:li[@class="resource"]'><xsl:sort select="text()" data-type = "text" order = "ascending" case-order = "lower-first"/>
+ * <xsl:value-of select="text()"/>
+</xsl:for-each></xsl:if></xsl:for-each></xsl:if>
</xsl:when>
<xsl:otherwise>
Move along! Nothing to see here!
Modified: incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/tests.py
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/tests.py?rev=672856&r1=672855&r2=672856&view=diff
==============================================================================
--- incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/tests.py (original)
+++ incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/tests.py Mon Jun 30 11:29:20 2008
@@ -225,4 +225,7 @@
self.auditor = diff.Auditor(TEST_BASE_DIR + "diff/", "audit")
def testLatestDiff(self):
- self.assertEquals("<div class='diff'><h1>From <a href='audit-2008-06-01.html' class='start-date'>2008-06-01</a> Till <a href='audit-2008-06-28.html' class='end-date'>2008-06-28</a></h1><h2>Added Resources</h2><ul class='added'><li class='dir'>scanner/sub/deep<ul><li class='resource'>HamletNot.txt</li></ul></li></ul><h2>Modified Resources</h2><ul class='modified'><li class='dir'>scanner/sub/deep<ul><li class='resource'>JuliusCaesar</li></ul></li></ul><h2>Removed Resources</h2><ul class='deleted'><li class='dir'>scanner/sub/deep<ul><li class='resource'>Hamlet.txt</li></ul></li></ul></div>", self.auditor.latestDiffs())
\ No newline at end of file
+ self.assertEquals("<div class='diff'><h1>From <a href='audit-2008-06-01.html' class='start-date'>2008-06-01</a> Till <a href='audit-2008-06-28.html' class='end-date'>2008-06-28</a></h1><h2>Added Resources</h2><ul class='added'><li class='dir'>scanner/sub/deep<ul><li class='resource'>HamletNot.txt</li></ul></li></ul><h2>Modified Resources</h2><ul class='modified'><li class='dir'>scanner/sub/deep<ul><li class='resource'>JuliusCaesar</li></ul></li></ul><h2>Removed Resources</h2><ul class='deleted'><li class='dir'>scanner/sub/deep<ul><li class='resource'>Hamlet.txt</li></ul></li></ul></div>", self.auditor.latestDiffs())
+
+ def testBogus(self):
+ connect.save("diff.html", connect.toXhtmlDocument(self.auditor.latestDiffs()))
\ No newline at end of file