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

Last () -1

Subject: Last () -1
From: "John Reid" <John.Reid@xxxxxxxxxxxxxxx>
Date: Sat, 4 Oct 2003 09:02:42 +1000
xsl last position
G'day,

I am not quite getting the results I expected and I suspect it is
because I am misreading how position and last works. I want to have a
variable that selects nodes, sorts the nodes and selects the last. If I
assume that the nodes are "numbered"  starting from the last as 
16, 15, 14, 13 ,12 

and I say 'day[position() &gt; last()-5 and position() &lt; last()-1]'
then am I selecting 14, 13 12.?? Maybe there is a better way

Any thoughts

Salud

John



<xsl:variable name="varL52">

<xsl:for-each select="day[position() &gt; last()-3 and position() &lt;
last()-1]">
<xsl:sort select="cl"  order="descending" data-type="number"/>
<xsl:if test="position()=last()"><xsl:value-of select="cl" /></xsl:if>
</xsl:for-each>

</xsl:variable>

	<asx id="AAI" coy="ALCOA INC." sector="Materials" asxNo="None"
currHi="6600" currCl="6600" currVol="0" currDate="20031002">
		<day id="20030804" weekno="1">
			<op>6600</op>
			<hi>6600</hi>
			<lo>6600</lo>
			<cl>6600</cl>
			<vol>0</vol>
		</day>
		<day id="20030805" weekno="1">
			<op>6600</op>
			<hi>6600</hi>
			<lo>6600</lo>
			<cl>6600</cl>
			<vol>0</vol>
		</day>
		<day id="20030806" weekno="1">
			<op>6600</op>
			<hi>6600</hi>
			<lo>6600</lo>
			<cl>6600</cl>
			<vol>0</vol>
		</day>
		<day id="20030807" weekno="1">
			<op>6600</op>
			<hi>6600</hi>
			<lo>6600</lo>
			<cl>6600</cl>
			<vol>0</vol>
		</day>
	</asx>


 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.