C
Craig
Hello there,
I'm trying to generate a hyperlink (href) using XSLT to generate a web
page that displays a table with selected information. At the moment
everything is working except for the hyperlink which I can't seem to
get my head around. I have the XSLT code listed below so if anyone can
let me know what the problem is with my script I would be greatly
appreciated. Here is the code:
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/REC-html40">
<xslutput method='html' version='1.0' encoding='UTF-8' indent='yes'/>
<xsl:template match="/">
<html>
<head>
<title>Bob Action Log</title>
</head>
<body>
<P>Here are the log files for the individual builds</P>
<table border="1">
<tr>
<th align="center">Build Step</th>
<th align="center">Arch</th>
<th align="center">Config</th>
<th align="center">Action</th>
<th align="center">Build Started At</th>
<th align="center">Build Time</th>
<th align="center">RESULT</th>
</tr>
<xsl:for-each select="BobActivityLog/ActionLog">
<tr>
<td><xsl:value-of select="StepName"/></td>
<td><xsl:value-of select="Arch"/></td>
<td><xsl:value-of select="Config"/></td>
<td><xsl:value-of select="Action"/></td>
<td><xsl:value-of select="TimeStamp"/></td>
<td><xsl:value-of select="BuildTime"/></td>
<xsl:choose>
<xsl:when test="Result = 0">
<td>PASS</td>
</xsl:when>
<xsltherwise>
<td bgcolor="pink">
<xsl:attribute name="title">
<xsl:value-of select="MainErr"/>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="StepName"/>
</xsl:attribute>
FAIL (<xsl:value-of select="Result"/>)</td>
</xsltherwise>
</xsl:choose>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I'm trying to generate a hyperlink (href) using XSLT to generate a web
page that displays a table with selected information. At the moment
everything is working except for the hyperlink which I can't seem to
get my head around. I have the XSLT code listed below so if anyone can
let me know what the problem is with my script I would be greatly
appreciated. Here is the code:
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/REC-html40">
<xslutput method='html' version='1.0' encoding='UTF-8' indent='yes'/>
<xsl:template match="/">
<html>
<head>
<title>Bob Action Log</title>
</head>
<body>
<P>Here are the log files for the individual builds</P>
<table border="1">
<tr>
<th align="center">Build Step</th>
<th align="center">Arch</th>
<th align="center">Config</th>
<th align="center">Action</th>
<th align="center">Build Started At</th>
<th align="center">Build Time</th>
<th align="center">RESULT</th>
</tr>
<xsl:for-each select="BobActivityLog/ActionLog">
<tr>
<td><xsl:value-of select="StepName"/></td>
<td><xsl:value-of select="Arch"/></td>
<td><xsl:value-of select="Config"/></td>
<td><xsl:value-of select="Action"/></td>
<td><xsl:value-of select="TimeStamp"/></td>
<td><xsl:value-of select="BuildTime"/></td>
<xsl:choose>
<xsl:when test="Result = 0">
<td>PASS</td>
</xsl:when>
<xsltherwise>
<td bgcolor="pink">
<xsl:attribute name="title">
<xsl:value-of select="MainErr"/>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="StepName"/>
</xsl:attribute>
FAIL (<xsl:value-of select="Result"/>)</td>
</xsltherwise>
</xsl:choose>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>