|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSLT Sort and choose last items problem
Thanks Jeni for the previous solution, but I do have an additional
problem:
This is best explained with an example: if you go to this page you will
see that there is a "Previous" link but no "Next" link -
http://journal.the-i.org/?31.01.2003
If you go to this page you will see there is a "Next" link but no
"Previous" link - http://journal.the-i.org/?01.02.2003
This is because, once again, the days span across a month element.
This is a sample XML file:
<journal>
<year>
<month date="1">
<day date="1">
<contents/>
<day date="2">
...
</month>
<month date="2">
<day date="1">
<contents/>
<day date="2">
...
</month>
...
</year>
</journal>
The complete xsl file can be viewed at
http://journal.the-i.org/xsl/day.xsl or the appropriate snippet for the
"Previous" link, (where $day is the numeric (xs:gDay) @date attribute of
the current day):
<xsl:if test="../day[@date=$day -1]">
<a href="?{../day[@date=$day
-1]/@date}.{../@date}.{../../@date}" title="View the previous journal
entry">
<xsl:text>Previous</xsl:text>
</a>
</xsl:if>
This works for day elements within the same month, but doesn't work for
the first or last day of a month.
Sincerely,
Ned Martin
http://nedmartin.org/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








