[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Simple question? element value last() - element value
This is, I think, pretty simple, but I'm just not getting it.
I want to output a number value = x where x = last <Work_Year> - first <Work_Year> /// I'm applying <xsl:template match="artist_works"> <xsl:for-each select="works_details"> <xsl:value-of select="Work_Year[last()] - Work_Year[1]"/> </xsl:for-each> </xsl:template> /// on the following XML /// <artist_works> <works_details> <Work_ID>1</Work_ID> <Work_Year>1945</Work_Year> </works_details> <works_details> <Work_ID>2</Work_ID> <Work_Year>1958</Work_Year> </works_details> <works_details> <Work_ID>3</Work_ID> <Work_Year>1972</Work_Year> </works_details> </artist_works> All I'm getting is "000", where in this example it should be "27" i.e 1972-1945 Can anyone advise? Best Regards J Milo Taylor
|
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
|