xsl-list
[Top] [All Lists]

Re: [xsl] selecting following attribute

2010-09-17 11:37:22
 On 9/17/2010 11:02 AM, Terry Ofner wrote:
My question: How do I select the first following @startNum?

This formulation 

<xsl:value-of select="following::*/@startNum[1] -1"/>

returns this error in Oxygen: Saxon B 9.0.0.6: A sequence of more than one 
item is not allowed as the first operand of '-'

I think besides what David Carlisle said, you could at least get better
typechecking by using number():

  <xsl:value-of select="number((following::*/@startNum)[1]) - 1"/>

Then if there was no following @startNum, the error would be thrown by 
number(). Or else you would get NaN?

Lars



--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>