Hi!
I use using the following style to display dependencies with an ant build.xml file.
<?xml version="1.0" encoding="cp1252"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output omit-xml-declaration="yes" indent="yes" />
<xsl:template match="project">
<html><head>
<style>
.left { font-size: 15px; color: #000000; text-align: right; font-family: arial, helvetica, sans-serif; background: #eeeeee; vertical-align: text-middle; }
.leftHigh { font-size: 15px; color: #FF0000; text-align: right; font-family: arial, helvetica, sans-serif; background: #eeeeee; vertical-align: text-middle; }
.right { font-size: 15px; color: #000000; text-align: left; font-family: arial, helvetica, sans-serif; font-style: italic; background: #f7f7f7; vertical-align: text-top; }
.rightDetail { font-size: 12px; color: #000000; text-indent: 15px; font-family: "Times New Roman", arial, helvetica, sans-serif; text-align: left; }
</style>
</head>
<script type="text/javascript">
function highlightList(origin, depends)
{
highlight(origin);
var token = depends.split(", ");
for (var i=0; i < token.length;i++)
{
highlight(token[i]);
}
}
function highlight(dep)
{
element = document.getElementById(dep);
if (element)
{
element.className = "leftHigh";
if (element.getAttribute("depends"))
{
highlightList('', element.getAttribute("depends"));
}
}
}
</script>
<body>
<table border="0" width="100%">
<xsl:apply-templates select="target" />
</table>
</body></html>
</xsl:template>
<xsl:template match="target">
<tr>
<td class="left">
<xsl:if test="@description">
<a depends="{@depends}" id="{@name}" href="javascript:highlightList('{@name}','{@depends}')">
<b>[<xsl:value-of select="@name" />]</b>
</a>
</xsl:if>
<xsl:if test="not(@description)">
<a depends="{@depends}" id="{@name}" href="javascript:highlightList('{@name}','{@depends}')">
[<xsl:value-of select="@name" />]
</a>
</xsl:if>
</td>
<td class="right">
<xsl:apply-templates select="@description" />
</td>
</tr>
<tr>
<td colspan="2" height="2px" bgcolor="#000000"></td>
</tr>
</xsl:template>
</xsl:stylesheet>
Hopefully I don't break this site's javascript code with this sniplet here.
Posted by: th_langer on October 31, 2005 at 01:30 AM