Newbie: XSLT substring or date format

David Bertolo

Usenet Archive
Joined
Feb 19, 2004
Messages
2
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top