Hi All,
I have a table which will be filled in automatically based on the following XSLT part:
I want to change this part, because the caption "Due date" contains a number, i want to add this number to the date 01-01-1900. In SQL you can do that with the dateadd function, but how to handle that within XSLT. Now i get:
Fieldname|Value
Due date|39450
and i want to have something like:
Fieldname|Value
Due date|2008-01-05
We need to do something like
select DATEADD("d",39450,'01-01-1900')
as in SQL server...
How to change the code, i think we need to use a choose funtion, below an example, can somebody assist me in the code?
Its the first time that im doing something with XSLT, i hope that the proffesionals here can give me the right way..
Thanks a lot.
Bill
I have a table which will be filled in automatically based on the following XSLT part:
Code:
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th>FieldName</th>
<th>Value</th>
</tr>
<xsl:for-each select="="/DATA_ROOT/BASIC/DATA_ITEM">
<xsl:if test="position() > 0 and position()*2 <= last()+1">
<tr>
<td><xsl:value-of select="CAPTION"/>  </td>
<td><xsl:value-of select="VALUE"/>  </td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
I want to change this part, because the caption "Due date" contains a number, i want to add this number to the date 01-01-1900. In SQL you can do that with the dateadd function, but how to handle that within XSLT. Now i get:
Fieldname|Value
Due date|39450
and i want to have something like:
Fieldname|Value
Due date|2008-01-05
We need to do something like
select DATEADD("d",39450,'01-01-1900')
as in SQL server...
How to change the code, i think we need to use a choose funtion, below an example, can somebody assist me in the code?
Code:
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th>FieldName</th>
<th>Value</th>
</tr>
<xsl:for-each select="/DATA_ROOT/BASIC/DATA_ITEM">
<xsl:if test="position() > 0 and position()*2 <= last()+1">
<tr>
<td><xsl:value-of select="CAPTION"/>  </td>
<xsl:choose>
<xsl: when CAPTION = 'Due date'"> then I need to do 1-1-1900 + VALUE</xsl:when>
<xsl:otherwise><td><xsl:value-of select="VALUE"/>  </td></xsl:otherwise>
</xsl:choose>
</tr>
</xsl:if>
</xsl:for-each>
</table>
Its the first time that im doing something with XSLT, i hope that the proffesionals here can give me the right way..
Thanks a lot.
Bill