Re: [xsl] more elegant way of doing this? (very simple)

Subject: Re: [xsl] more elegant way of doing this? (very simple)
From: Steve <subsume@xxxxxxxxx>
Date: Wed, 16 Aug 2006 12:56:40 -0400
Wow, that's pretty.

I'll have to look up self::

Thanks buddy,

-S

On 8/16/06, David Carlisle <davidc@xxxxxxxxx> wrote:

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