ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/etc junit-noframes.xsl
Date Sun, 19 Aug 2001 18:22:22 GMT
sbailliez    01/08/19 11:22:22

  Modified:    src/etc  Tag: ANT_14_BRANCH junit-noframes.xsl
  Log:
  Added a way to display properties from testcase.
  This is based on an article from Erik Hatcker <erik@hatcher.net>
  It will not work with Netscape 4.x but should be ok with Netscape 6.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +49 -34    jakarta-ant/src/etc/junit-noframes.xsl
  
  Index: junit-noframes.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/junit-noframes.xsl,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- junit-noframes.xsl	2001/08/07 22:03:27	1.1
  +++ junit-noframes.xsl	2001/08/19 18:22:22	1.1.2.1
  @@ -1,16 +1,4 @@
   <xsl:stylesheet	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  -
  -
  -<!-- ======================================================================
  -
  -	Stylesheet to transform an XML file generated by the Ant MAudit task into
  -	a set of JavaDoc-like HTML page to make pages more convenient to be browsed.
  -	
  -	It use the Xalan redirect extension to write to multiple output files.
  -	
  -	Note: HTML output can be made much more clean by removing non css attributes
  -
  -	====================================================================== -->
   <xsl:output method="html" indent="yes"/>
   <xsl:decimal-format decimal-separator="." grouping-separator="," />
   
  @@ -33,6 +21,25 @@
   		TABLE.details TR TD{
   			background:#EEEEE0;
   		}
  +
  +    TABLE.properties {
  +    	border-collapse:collapse;
  +    	border-left:solid 1 #CCCCCC; border-top:solid 1 #CCCCCC;
  +    	padding:5px;
  +    }
  +    
  +    TABLE.properties TH {
  +      text-align:left;
  +    	border-right:solid 1 #CCCCCC; border-bottom:solid 1 #CCCCCC;
  +    	background-color:#EEEEEE;
  +    }
  +    
  +    TABLE.properties TD {
  +    	font:normal;
  +    	text-align:left;
  +    	border-right:solid 1 #CCCCCC; border-bottom:solid 1 #CCCCCC;
  +    	background-color:#FFFFFFF;
  +    }
   		
   		P {
   			line-height:1.5em;
  @@ -63,6 +70,13 @@
   			font-weight:bold; color:purple;
   		}
   		</style>
  +      <script language="JavaScript"><![CDATA[   
  +        function toggle (field)
  +        {
  +          field.style.display = (field.style.display == "block") ? "none" : "block";
  +        }  ]]> 
  +      </script>
  +
   		</HEAD>
   		<body>
   			<a name="#top"></a>
  @@ -223,29 +237,32 @@
   		</table>
   	</xsl:template>
   	
  -	<xsl:template match="properties">
   	<!--
  -	    I have NO idea how to display properties ! :-(
  -	    It takes an incredible amount of space in the page and it's
  -	    really unreadable.
  -	    <xsl:variable name="count" select="count(property)"/>
  -	    <h3>System Properties</h3>
  -		<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
  -		<tr valign="top">
  -			<th>Name</th>
  -			<th>Value</th>
  -		</tr>
  -		<xsl:for-each select="property">
  -			<tr valign="top">
  -				<td><xsl:value-of select="@name"/></td>
  -				<td><xsl:value-of select="@value"/></td>
  -			</tr>
  -		</xsl:for-each>
  -		</table>
  -	-->
  +	 Simple way to display properties, it is not very nice but it does
  +	 the job. Properties are sorted so that they can be found easily.
  +	 This is based on the original idea by Erik Hatcher (erik@hatcher.net)
  +	 -->
  +	<xsl:template match="properties">
  +	  <xsl:variable name="id" select="concat(translate(../@package,'.','_'),'_', ../@name)"/>
  +	  <i><a href="javascript:toggle({$id});">Show/Hide System Properties &gt;&gt;</a></i>
  +	  <div id="{$id}" style="display:none">
  +		  <table class="properties" border="0" cellpadding="5" cellspacing="2" width="95%">
  +		    <xsl:for-each select="property[position() mod 2 = 1]">
  +	      <xsl:sort select="@name"/>
  +		    <xsl:variable name="nextProperty" select="following-sibling::property[1]" />
  +			  <tr valign="top">
  +				  <th><xsl:value-of select="@name"/></th>
  +				  <td><xsl:value-of select="@value"/></td>
  +				  <td/>
  +				  <th><xsl:value-of select="$nextProperty/@name"/></th>
  +				  <td><xsl:value-of select="$nextProperty/@value"/></td>
  +			  </tr>			  
  +		    </xsl:for-each>
  +		  </table>
  +	  </div>
  +	  <p/>
   	</xsl:template>
   	
  -	
   <!-- Page HEADER -->
   <xsl:template name="pageHeader">
   	<h1>Unit Test Results</h1>
  @@ -345,8 +362,6 @@
   </xsl:template>
   
   
  -<!-- Note : the below template error and failure are the same style
  -			so just call the same style store in the toolkit template -->
   <xsl:template match="failure">
   	<xsl:call-template name="display-failures"/>
   </xsl:template>
  
  
  

Mime
View raw message