Subject: Re: [xsl] more elegant way of doing this? (very simple) From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Wed, 16 Aug 2006 12:54:11 -0400 |
Summing up 3 specifically named nodes under Records/Record and summing them only if they are numbers.
Current XSL===>
sum(Records/Record/*[name(.) = 'AContribution' and number(.) = number(.) or name(.) = 'BContribution' and number(.) = number(.) or name(.) = 'CContribution' and number(.) = number(.)])
sum( ( Records/Record/AContribution | Records/Record/BContribution | Records/Record/CContribution )[number(.)=number(.)] )
I'm just trying to reduce redundancy.
You don't say *where* you want to reduce redundancy ... the above syntactically reduces your expression ... I cannot comment on the speed as that would be dependent on your processor so I don't think the question can be answered in that way.
-- UBL/XML/XSLT/XSL-FO training: Verx, Denmark 06-09-25/10-06 World-wide corporate, govt. & user group UBL, XSL, & XML training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] more elegant way of doing, Steve | Thread | [xsl] Interesting problem: Combing , Ed Yau |
Re: [xsl] more elegant way of doing, David Carlisle | Date | Re: [xsl] Need help with XSLT: addi, Nishi Bhonsle |
Month |