Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Displaying items after a certain date

Reply
Thread Tools

Displaying items after a certain date

 
 
paul.boparai@gmail.com
Guest
Posts: n/a
 
      06-06-2007
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

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      06-06-2007
> 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
 
Reply With Quote
 
 
 
 
paul.boparai@gmail.com
Guest
Posts: n/a
 
      06-06-2007
On Jun 6, 4:38 pm, Joe Kesselman <(E-Mail Removed)> 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

 
Reply With Quote
 
Joe Kesselman
Guest
Posts: n/a
 
      06-07-2007
>>> 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
 
Reply With Quote
 
paul.boparai@gmail.com
Guest
Posts: n/a
 
      06-07-2007
On Jun 6, 5:49 pm, Joe Kesselman <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Vista cannot obtain an IP address from certain routers or from certain non-Microsoft DHCP Brian W Wireless Networking 7 01-31-2010 03:46 AM
Binding certain rows to certain columns in GridView? bernard.oflynn@gmail.com ASP .Net 2 03-25-2008 03:49 PM
Expanding certain path to certain node in a JTree arun.hallan@gmail.com Java 0 01-08-2005 08:26 PM
Automatically delete files after a certain date Allan Martin Java 2 07-05-2004 03:31 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM



Advertisments