D
David Bertolo
Hi
I'm currently using an existing xsl file to display an XML file.
But I would like change the date format from 2004/02/18-17:26 to 2004/02/18.
I'm trying to find some examples with format date or substring function but
it doesn't work.
There are in comment the two things that I have tried.
My xsl file is:
<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<body>
<table border="1" cellpadding="8" cellspacing="0">
<tr>
<td bgcolor="#88CCAA"><center><i><b>Name</b></i></center></td>
<td bgcolor="#88CCAA"><center><i><b>Date</b></i></center></td>
<td bgcolor="#88CCAA"><center><i><b>Size</b></i></center></td>
</tr>
<xsl:for-each select="Elements/Element">
<tr>
<td bgcolor="#EEDDFF"><xsl:value-of select="@Name"/></td>
<td bgcolor="#EEDDFF"><xsl:value-of select="@Date"/></td>
<!--<td bgcolor="#EEDDFF"><xsl:value-of
select="substring(@Date,1,10)"/></td> -->
<!--<td bgcolor="#EEDDFF"><xsl:value-of
select="substring-before(@Date,'-')"/></td>-->
<td bgcolor="#EEDDFF"><xsl:value-of select="@size"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Thank you in advance
David
I'm currently using an existing xsl file to display an XML file.
But I would like change the date format from 2004/02/18-17:26 to 2004/02/18.
I'm trying to find some examples with format date or substring function but
it doesn't work.
There are in comment the two things that I have tried.
My xsl file is:
<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<body>
<table border="1" cellpadding="8" cellspacing="0">
<tr>
<td bgcolor="#88CCAA"><center><i><b>Name</b></i></center></td>
<td bgcolor="#88CCAA"><center><i><b>Date</b></i></center></td>
<td bgcolor="#88CCAA"><center><i><b>Size</b></i></center></td>
</tr>
<xsl:for-each select="Elements/Element">
<tr>
<td bgcolor="#EEDDFF"><xsl:value-of select="@Name"/></td>
<td bgcolor="#EEDDFF"><xsl:value-of select="@Date"/></td>
<!--<td bgcolor="#EEDDFF"><xsl:value-of
select="substring(@Date,1,10)"/></td> -->
<!--<td bgcolor="#EEDDFF"><xsl:value-of
select="substring-before(@Date,'-')"/></td>-->
<td bgcolor="#EEDDFF"><xsl:value-of select="@size"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Thank you in advance
David