Hi All,
I have an xml structure:
<Date>Mon, 11 Aug 2009 13:15:10 GMT</Date>
i want to extract only 13:15 or '13' and '15'. What is the best way to do that using xslt
Hi All,
I have an xml structure:
<Date>Mon, 11 Aug 2009 13:15:10 GMT</Date>
i want to extract only 13:15 or '13' and '15'. What is the best way to do that using xslt
I found this in a discussion - http://geekswithblogs.net/workdog/archive/2007/02/08/105858.aspx which might help you.
If you can use XPath 2.0, you could use tokenize():
XML
<?xml version="1.0" encoding="UTF-8"?>
<Date>Mon, 11 Aug 2009 13:15:10 GMT</Date>
XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/Date">
<xsl:value-of select="tokenize(tokenize(.,' ')[5],':')[position() < 3]"/>
</xsl:template>
</xsl:stylesheet>
OUTPUT
13 15