alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Ant example source code file (tagdiff.xsl)

This example Ant source code file (tagdiff.xsl) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Ant tags/keywords

apache, asf, files, files, license, license, modified, modified, new, new, removed, see, top, you

The tagdiff.xsl source code

<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<!-- a stylesheet to display changelogs ala netbeans -->
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
  <xsl:param name="title"/>
  <xsl:param name="module"/>
  <xsl:param name="cvsweb"/>

  <xsl:output method="html" indent="yes"/>

  <!-- Copy standard document elements.  Elements that
       should be ignored must be filtered by apply-templates
       tags. -->
  <xsl:template match="*">
    <xsl:copy>
      <xsl:copy-of select="attribute::*[. != '']"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="tagdiff">
    <html>
      <head>
        <title>
        <style type="text/css">
          body, p {
          font-family: verdana,arial,helvetica;
          font-size: 80%;
          color:#000000;
          }
	  .dateAndAuthor {
          font-family: verdana,arial,helvetica;
          font-size: 80%;
          font-weight: bold;
          text-align:left;
          background:#a6caf0;
	  }
          tr, td{
          font-family: verdana,arial,helvetica;
          font-size: 80%;
          background:#eeeee0;
          }	  
	  </style> 
      </head>
      <body link="#000000" alink="#000000" vlink="#000000" text="#000000">       
          <h1>
            <a name="top">
          </h1>
          Tagdiff between <xsl:value-of select="@startTag"/>  and
			<xsl:value-of select="@endTag"/> 
          <p align="right">Designed for use with Ant.

<hr size="2"/> <a name="TOP"/> <table width="100%"> <tr> <td align="right"> <a href="#New">New Files | <a href="#Modified">Modified Files | <a href="#Removed">Removed Files </td> </tr> </table> <table border="0" width="100%" cellpadding="3" cellspacing="1"> <xsl:call-template name="show-entries"> <xsl:with-param name="title">New Files <xsl:with-param name="anchor">New <xsl:with-param name="entries" select=".//entry[file/revision][not(file/prevrevision)]"/> </xsl:call-template> <xsl:call-template name="show-entries"> <xsl:with-param name="title">Modified Files <xsl:with-param name="anchor">Modified <xsl:with-param name="entries" select=".//entry[file/revision][file/prevrevision]"/> </xsl:call-template> <!-- change to entries select to address bug #36827 --> <xsl:call-template name="show-entries"> <xsl:with-param name="title">Removed Files <xsl:with-param name="anchor">Removed <xsl:with-param name="entries" select=".//entry[not(file/revision)][file/prevrevision]"/> </xsl:call-template> </table> </body> </html> </xsl:template> <xsl:template name="show-entries"> <xsl:param name="title"/> <xsl:param name="anchor"/> <xsl:param name="entries"/> <tr> <td colspan="2" class="dateAndAuthor"> <a> <xsl:attribute name="name"> <xsl:value-of select="$title"/> - entries </a> <a href="#TOP">(back to top) </td> </tr> <tr> <td width="20"> <xsl:text> </td> <td> <ul> <xsl:apply-templates select="$entries"/> </ul> </td> </tr> </xsl:template> <xsl:template match="entry"> <xsl:apply-templates select="file"/> </xsl:template> <xsl:template match="date"> <i> </xsl:template> <xsl:template match="time"> <i> </xsl:template> <xsl:template match="author"> <i> <a> <xsl:attribute name="href">mailto: <xsl:value-of select="."/> </a> </i> </xsl:template> <xsl:template match="file"> <li> <a target="_new"> <xsl:attribute name="href">/ <xsl:value-of select="name" /> </a> <xsl:if test="string-length(prevrevision) > 0 or string-length(revision) > 0"> <xsl:text> <a target="_new"> <xsl:choose> <xsl:when test="string-length(prevrevision) = 0 "> <xsl:attribute name="href">/?rev=&content-type=text/x-cvsweb-markup </xsl:when> <xsl:otherwise> <xsl:attribute name="href">/?r1=&r2=&diff_format=h </xsl:otherwise> </xsl:choose> () </a> </xsl:if> </li> </xsl:template> <!-- Any elements within a msg are processed, so that we can preserve HTML tags. --> <xsl:template match="msg"> <b> </xsl:template> </xsl:stylesheet>

Other Ant examples (source code examples)

Here is a short list of links related to this Ant tagdiff.xsl source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.