RE: A more concise way to handle empty numeric element
> hmmm it's a bit hacky but you can do: > > <xsl:variable name="zero">0</xsl:variable> > > <xsl:value-of select="(cost1/text()|$zero) + > (cost2/text()|$zero) + (cost3/text()|$zero)"/> Unfortunately you can't predict which of (cost2/text()) and $zero will come first in document order. > > hopefully someone else will have a better idea... Yes, and I missed it: just sum over the non-empty nodes! Michael Kay http://www.saxonica.com/
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