[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: more elegant way of doing this? (very simple)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 16 Aug 2006 17:53:03 +0100
unless you really need to always use a node test 
AContribution rather than name()='AContribution'
It's namespace aware and likely more efficient.

Are you using xsl 1 or 2?

xpath 1:

sum(Records/Record/*[self::AContribution|self::BContribution|self::CContribution][number()=number()])

xpath2 you can do the same, or a bit more simply:

sum(Records/Record/(AContribution|BContribution|CContribution)[number()=number()])

David

Current Thread
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member