Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2009, 01:23 PM
Authorized User
 
Join Date: Sep 2009
Posts: 14
Thanks: 6
Thanked 0 Times in 0 Posts
Default Substring function in xlst 1.0 troubeshooting

The following portion of my xlst file returns no value from the time element. If Time = 2009-11-01T12:00:00blah the transform should return 2009-11-01T12:00:00 only. Can you assist? I am using xslt 1.0.

Code:
<ns:Time>M</ns:Time>

XLST
Code:
<xsl:template match="ns:prsi/ns:Time">
<xsl:copy>
			<xsl:value-of select='substring(ns:prsi/ns:Time, 1, 19)'/>
</xsl:copy>
	</xsl:template>
 
Old November 18th, 2009, 01:30 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Code:
<xsl:value-of select="substring(., 1, 19)"/>
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
The Following User Says Thank You to Martin Honnen For This Useful Post:
fixit (November 18th, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
substring-before() function. lafilip XSLT 1 July 11th, 2007 05:33 PM
how to use pagination in xsl or xlst vijayanmsc XSLT 1 June 6th, 2006 06:07 AM
XLST Multiple Foreach deepsweech XSLT 3 June 20th, 2005 09:46 AM
XLST transformNode problem beyondtron Classic ASP XML 0 February 4th, 2004 04:52 PM
XLST vs Sever Controls skin XSLT 3 July 11th, 2003 01:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.