xsl-list
[Top] [All Lists]

Re: AW: Selecting entries by date

2003-08-03 20:54:02
Markus Abt wrote:

Put the variable and the <xsl:if> inside the <xsl:for-each> loop to get only 
the
wanted entries:

Yes, this does the trick.
 
Further, you can eleminate the variable and maybe also the <xsl:if>, simply 
write:

 <xsl:for-each select="hbuddhism/entry[translate(dateofentry, '-', '') &lt; 
$thismonth]">
  <xsl:sort select="lastname"/>

But this is even better, because, as you say, it resolves the next
problem I was going to have to deal with -- making sure the numbering
was being done on the output data only as opposed to the entire data set:

In this case, however, the selected entries are numbered 1, 2, 3, ... by the 
position()
function, since only the selected ones are looped through the <xsl:for-each>.
In the first case above, all entries are looped through and numbered with 
their
position, and then only the ones with the right date are outputted, so numbers
look like 2, 5, 6, 8, ..., for example.

Thank you!

Chuck

---------------------------
Charles Muller  <acmuller(_at_)gol(_dot_)com>
Faculty of Humanities,  Toyo Gakuen University
Digital Dictionary of Buddhism and CJKV-English Dictionary 
[http://www.acmuller.net]
H-Buddhism List Editor [http://www.h-net.org/~buddhism/]
Mobile Phone: 090-9310-1787

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



<Prev in Thread] Current Thread [Next in Thread>