RE: [xsl] Using XSL for a "world records" table

Subject: RE: [xsl] Using XSL for a "world records" table
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Sun, 18 May 2003 18:04:40 +0100
Hopefully someone will offer you an XSLT 1.0 solution, but I'd just like
to observe that all three requirements are really easy in XSLT 2.0. The
first one is handled by xsl:for-each-group; the second by testing $date
> (current-date() - xs:dayTimeDuration('PT14D')); and the third by
format-time().

Michael Kay


> I am developing an xsl template that will produce a world 
> records page in html. To see what I'm talking about, you can 
> view the original records page, which is currently generated 
> from a spreadsheet:
> 
	http://www.speedcubing.com/records/recs_cube_333.html

I have succeeded in handling the basic requirements in xsl, but I have
run into a few problems:

- notice in the existing records page that two people are tied for first
  place. In this case, they should both have "1" in the "Place" column.
  My current approach fails: when I sort on the time column and use the
  value of position() for place, it unfairly gives one of them second
  place. Is there another way?

- recent records are given a yellow background so they stand out. To do
  this, I need to test if the record date is greater-than 14 days ago.
  My current idea for this is to store dates in yyyymmdd format, and
  pass the date of 14 days ago as an xsl parameter. Then colour yellow
  each record if its date is greater than the parameter. Can anyone
  think of a better way that doesn't require such a parameter?

- the time field needs to be formatted for any value from hundredths of
  a second up to days or years. Will I need to write my own extension
  function to do the formatting, or does one exist already?

Thanks for your help

Ryan

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread