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

Re: selecting following attribute

Subject: Re: selecting following attribute
From: Lars Huttar <lars_huttar@xxxxxxx>
Date: Fri, 17 Sep 2010 11:37:09 -0500
Re:  selecting following attribute
 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

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.