Re: [xsl] value-of select - then multiply

Subject: Re: [xsl] value-of select - then multiply
From: Adam Nielsen <adam.nielsen@xxxxxxxxx>
Date: Thu, 19 Jun 2008 10:30:25 +1000
<xsl:value-of select="(Work_Location_longitude/position() - 1) * 15"/>

If there are three WLL elements, then WLL/position() returns the sequence (1,2,3), and subtracting one from this sequence is an error.

Oh right, of course you'd need to stick it in something like a for-each and then not specify the element name specifically. Or maybe use count() instead of position() depending on what the OP wanted to achieve.


It always seems so obvious once your mistakes have been pointed out ;-)

Cheers,
Adam.

Current Thread