Re: [xsl] Saxon processing problem...

Subject: Re: [xsl] Saxon processing problem...
From: Eliot Kimber <ekimber@xxxxxxxxxxxx>
Date: Sun, 30 Mar 2008 10:07:38 -0500
Michael Kay wrote:
select="*/tbody/row[position() mod $grp-size=1].

And this expression looks a little fishy since $grp-size=1 will return a boolean value which is probably not a meaningful argument for "mod".

Eliot's other comments are all valid but this one's wrong, I think. The
"mod" operator has higher precedence than "=". Mind you, it would probably
be worth writing it as

[(position() mod $grp-size) = 1]

so that other people reading your code don't make the same mistake.

Thanks for pointing this out--I should have double checked the precedence rules.

Maybe it's because I always depend on parentheses that I don't really bother to learn the precedence rules for different languages....


Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 610.631.6770

Current Thread