Wrox Programmer Forums
|
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 July 12th, 2007, 07:44 AM
Authorized User
 
Join Date: Jul 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Michael,

Thanks, Yeaaah it is working.

Thanks a lot. Youre great.





 
Old July 12th, 2007, 06:11 PM
Authorized User
 
Join Date: Jul 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi michael,

do you also know how I translate 12-01-2004T12:00:00 to only 12-01-2004 withoudt te time in xslt?

<Issue> <IssueHistory_CreationDate>2004-01-01T12:00:00</IssueHistory_CreationDate>
      <Status>
      <Name>test</Name>
   </Status> <IssueHistory_CreationDate>2004-01-02T12:00:00</IssueHistory_CreationDate>
    <Status>
        <Name>test</Name>
   </Status>
   </Issue>

thanks.



 
Old July 13th, 2007, 03:51 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Use the substring-before() function.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 13th, 2007, 06:46 AM
Authorized User
 
Join Date: Jul 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes i know that. But I want select all the IssueHistory_Creationdate and not one. And also it must be iteratieve. I dont't want to mention the date in the variable.

It must be iteratieve that alle the dates is been showing.


<xsl:variable name = "A" >2004-01-01T</xsl:variable>
 <xsl:for-each select="Issue/IssueHistory_CreationDate">
                <String><xsl:apply-templates/></String>
                <xsl:value-of select = "substring-before($A, 'T')"/>
  </xsl:for-each>

this is the result:

<?xml version="1.0" encoding="UTF-8"?>
<String>2004-01-01T:00:00</String>2004-01-01
<String>2004-01-02T:00:00</String>2004-01-01

I want to show this:
<String>2004-01-01</String>
<String>2004-01-02</String>

 
Old July 13th, 2007, 08:25 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I don't really understand your question. It looks to me as if you want

 <xsl:for-each select="Issue/IssueHistory_CreationDate">
                <String><xsl:value-of select = "substring-before(., 'T')"/></String>

  </xsl:for-each>

But you make it seem a lot more complicated than that.


Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 13th, 2007, 08:44 AM
Authorized User
 
Join Date: Jul 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Michael,

Thank you so very much. It works.








Similar Threads
Thread Thread Starter Forum Replies Last Post
SORTING pallone XSLT 3 October 29th, 2006 08:45 AM
Sorting sunny76 Excel VBA 2 September 19th, 2005 09:31 PM
Datagrid sorting by non alphabetical sorting? LLAndy VS.NET 2002/2003 1 July 15th, 2004 01:20 AM
Sorting? pbernardo XSLT 2 October 27th, 2003 11:34 AM
Need help Sorting athanatos XSLT 5 August 11th, 2003 07:51 PM





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