[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSLT Sort and choose last items problem

Subject: RE: XSLT Sort and choose last items problem
From: "thei" <thei@xxxxxxxxx>
Date: Tue, 11 Feb 2003 01:20:56 +1000
xslt preceding sibling last
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.