sorting nodes by date in XSL

Discussion in 'XML' started by andy, Mar 23, 2008.

  1. andy

    andy Guest

    I have a series of xml nodes like the following...

    <MatchedItem>
    <DateMatched>2008-03-23T03:15:33.84375+00:00</DateMatched>
    <Url>http://www.mininova.org/get/1264031</Url>
    <PatternMatched>
    <PatternString>daily.show</PatternString>
    <MatchOnce>false</MatchOnce>
    </PatternMatched>
    <Title>Jon Stewart &amp; Daily Show - America - A Citizen's Guide
    to Democracy Inaction [MakeGreatMusic.Net (5S/0L)</Title>
    <FeedName>Mininova</FeedName>
    <Size>78.022</Size>
    </MatchedItem>


    I would like to group nodes by the date, specifically I would like all
    the nodes that have the day to be together in a html table when you view
    the xml file in browser.

    Could someone give me some pointers as to how to achieve this ?.

    Any help appreciated.

    --
    Eps
    andy, Mar 23, 2008
    #1
    1. Advertising

  2. andy wrote:

    > I would like to group nodes by the date, specifically I would like all
    > the nodes that have the day to be together in a html table when you view
    > the xml file in browser.
    >
    > Could someone give me some pointers as to how to achieve this ?.


    If you use XSLT 2.0 (e.g. with Saxon or Gestalt or AltovaXML) then you
    have support for xs:date and xs:dateTime data types and you have
    xsl:for-each-group to group.

    With XSLT 1.0 you need to use Muenchian grouping:
    <URL:http://www.jenitennison.com/xslt/grouping/index.xml>


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Mar 23, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,243
    Michael Borgwardt
    May 30, 2004
  2. asd
    Replies:
    3
    Views:
    435
    Arnaud Berger
    May 23, 2005
  3. gavnosis
    Replies:
    0
    Views:
    510
    gavnosis
    Aug 2, 2003
  4. Sparko
    Replies:
    0
    Views:
    408
    Sparko
    Jul 9, 2004
  5. Replies:
    1
    Views:
    3,595
    A. Bolmarcich
    May 27, 2005
Loading...

Share This Page