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
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--