A
aidy
Hi,
Here is my xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="testresults">
<table border="2">
<tr>
<td><b>TESTID</b></td>
<td><b>TEST DESCRIPTION</b></td>
<td><b>STATUS</b></td>
<td><b>MESSAGE</b></td>
</tr>
<xsl:apply-templates />
</table>
</xsl:template>
<xsl:template match="test">
<xsl:for-each select="teststatus">
<tr>
<td>
<xsl:if test="position()=1">
<xsl:value-of select="../@id"/>
</xsl:if>
</td>
<td><xsl:value-of select="../description"/></td>
<xsl:choose>
<xsl:when test=".= 'ACTION'">
<td bgcolor="#FFFF00"><xsl:value-of select="."/></td>
</xsl:when>
<xsl:when test=".= 'PASS'">
<td bgcolor="#00ff00"><xsl:value-of select="."/></td>
</xsl:when>
<xsl:when test=".= 'FAIL'">
<td bgcolor="#FF0000"><xsl:value-of select="."/></td>
</xsl:when>
</xsl:choose>
<td><xsl:value-of select="following-sibling::message[1]"/></
td>
</tr>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
ACTION and FAIL have messages associated with them but PASS doesn't
here is the xml
- <testresults>
- <test id="Register">
<description>Register a x account</description>
<teststatus>ACTION</teststatus>
<message>gone to http://x.com/</message>
<teststatus>ACTION</teststatus>
<message>HTML text of Whoops, we are sorry but an error has
occurred... is being verified</message>
<teststatus>PASS</teststatus>
<teststatus>ACTION</teststatus>
<message>HTML text of The generated code you entered was incorrect
is being verified</message>
<teststatus>PASS</teststatus>
<teststatus>ACTION</teststatus>
<message>HTML text of You appear to have an active account with this
email address. is being verified</message>
<teststatus>FAIL</teststatus>
<message>You appear to have an active account with this email
address</message>
<teststatus>ACTION</teststatus>
<message>clicked log out</message>
<teststatus>FAIL</teststatus>
<message>Need to check registered email here, but not having success
with Admin MasterRegCode</message>
<teststatus>ACTION</teststatus>
<message>browser has been closed</message>
</test>
At the moment the xsl create messages for PASS in the HTML. I need
to prevent this.
Aidy
Here is my xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="testresults">
<table border="2">
<tr>
<td><b>TESTID</b></td>
<td><b>TEST DESCRIPTION</b></td>
<td><b>STATUS</b></td>
<td><b>MESSAGE</b></td>
</tr>
<xsl:apply-templates />
</table>
</xsl:template>
<xsl:template match="test">
<xsl:for-each select="teststatus">
<tr>
<td>
<xsl:if test="position()=1">
<xsl:value-of select="../@id"/>
</xsl:if>
</td>
<td><xsl:value-of select="../description"/></td>
<xsl:choose>
<xsl:when test=".= 'ACTION'">
<td bgcolor="#FFFF00"><xsl:value-of select="."/></td>
</xsl:when>
<xsl:when test=".= 'PASS'">
<td bgcolor="#00ff00"><xsl:value-of select="."/></td>
</xsl:when>
<xsl:when test=".= 'FAIL'">
<td bgcolor="#FF0000"><xsl:value-of select="."/></td>
</xsl:when>
</xsl:choose>
<td><xsl:value-of select="following-sibling::message[1]"/></
td>
</tr>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
ACTION and FAIL have messages associated with them but PASS doesn't
here is the xml
- <testresults>
- <test id="Register">
<description>Register a x account</description>
<teststatus>ACTION</teststatus>
<message>gone to http://x.com/</message>
<teststatus>ACTION</teststatus>
<message>HTML text of Whoops, we are sorry but an error has
occurred... is being verified</message>
<teststatus>PASS</teststatus>
<teststatus>ACTION</teststatus>
<message>HTML text of The generated code you entered was incorrect
is being verified</message>
<teststatus>PASS</teststatus>
<teststatus>ACTION</teststatus>
<message>HTML text of You appear to have an active account with this
email address. is being verified</message>
<teststatus>FAIL</teststatus>
<message>You appear to have an active account with this email
address</message>
<teststatus>ACTION</teststatus>
<message>clicked log out</message>
<teststatus>FAIL</teststatus>
<message>Need to check registered email here, but not having success
with Admin MasterRegCode</message>
<teststatus>ACTION</teststatus>
<message>browser has been closed</message>
</test>
At the moment the xsl create messages for PASS in the HTML. I need
to prevent this.
Aidy