I am trying to replace the different status indicators (e.g. Y or N) of a column "Status_Ind" with images. I would like to create "traffic lights" where:
- "Completed" is replaced with /img/green.jpg
- "In Progress" is replaced with /img/yellow.jpg
Input XML:
<Rowsets>
<Rowset>
<Columns>
<Column Description="Status_Ind"/>
<Column Description="Name"/>
</Columns>
<Row>
<Status_Ind>Completed</Status_Ind>
<Name>TASK1</Name>
</Row>
<Row>
<Status_Ind>In Progress</Status_Ind>
<Name>TASK2</Name>
</Row>
</Rowset>
</Rowsets>
For the XSLT, I am using the code in https://stackoverflow.com/a/8841189/1130511
My attempt:
<xsl:template match="@Description='Status_Ind']">
<xsl:choose>
<xsl:when test="Completed">
<img src="../img/green.jpg" />
</xsl:when>
<xsl:when test="In Progress">
<img src="../img/yellow.jpg" />
</xsl:when>
</xsl:choose>
</xsl:template>