Displaying items after a certain date

Discussion in 'XML' started by paul.boparai@gmail.com, Jun 6, 2007.

  1. Guest

    Hi,

    I have elements tagged with a date attribute in my XML files. The
    attribute takes in text formatted like so:

    2007 Jan 04
    2006 Mar 22

    Four numbers for the year
    A space
    Three letters for the month
    A space
    Two numbers for the day of the month

    My question is, if I specify in a universal "revisiondate" element
    another date, how can I make sure dates after the revision date are
    shown. So for example, if I use "2006 Jul 21" in revision date, I
    want to select all elements with date attributes that are later than
    July 21st, 2006 and not have anything before this date.

    Cheers,
    Paul
     
    , Jun 6, 2007
    #1
    1. Advertising

  2. > My question is, if I specify in a universal "revisiondate" element
    > another date, how can I make sure dates after the revision date are
    > shown.


    Using what language to process the document? (XSLT 1.0 or 2.0? Java?
    Javascript? Other?)


    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, Jun 7, 2007
    #2
    1. Advertising

  3. Guest

    On Jun 6, 4:38 pm, Joe Kesselman <> wrote:
    > > My question is, if I specify in a universal "revisiondate" element
    > > another date, how can I make sure dates after the revision date are
    > > shown.

    >
    > Using what language to process the document? (XSLT 1.0 or 2.0? Java?
    > Javascript? Other?)
    >
    > --
    > () ASCII Ribbon Campaign | Joe Kesselman
    > /\ Stamp out HTML e-mail! | System architexture and kinetic poetry


    XSLT 1.0
     
    , Jun 7, 2007
    #3
  4. >>> My question is, if I specify in a universal "revisiondate" element
    >>> another date, how can I make sure dates after the revision date are
    >>> shown.

    > XSLT 1.0


    XSLT 1.0 has no date-compare capability built in. Two possible
    approaches are to write string-processing/math/table logic to convert
    dates to integers, or to use an extension function to perform that
    operation. (A bit of hand-coded Java -- I've seen folks just invoke Java
    library objects directly for this purpose -- or the EXSLT date
    operations if your processor support them.)

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, Jun 7, 2007
    #4
  5. Guest

    On Jun 6, 5:49 pm, Joe Kesselman <> wrote:
    > >>> My question is, if I specify in a universal "revisiondate" element
    > >>> another date, how can I make sure dates after the revision date are
    > >>> shown.

    > > XSLT 1.0

    >
    > XSLT 1.0 has no date-compare capability built in. Two possible
    > approaches are to write string-processing/math/table logic to convert
    > dates to integers, or to use an extension function to perform that
    > operation. (A bit of hand-coded Java -- I've seen folks just invoke Java
    > library objects directly for this purpose -- or the EXSLT date
    > operations if your processor support them.)
    >
    > --
    > () ASCII Ribbon Campaign | Joe Kesselman
    > /\ Stamp out HTML e-mail! | System architexture and kinetic poetry


    Yeah I'm thinking of going with the string-processing approach. Just
    need some help in that department.

    Cheers.
     
    , Jun 7, 2007
    #5
    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,300
    Michael Borgwardt
    May 30, 2004
  2. Allan Martin
    Replies:
    2
    Views:
    7,082
    Roedy Green
    Jul 5, 2004
  3. Replies:
    0
    Views:
    664
  4. Replies:
    2
    Views:
    536
    bruce barker
    Mar 25, 2008
  5. SAN CAZIANO
    Replies:
    8
    Views:
    186
    Dr John Stockton
    Oct 15, 2004
Loading...

Share This Page