xsl-list
[Top] [All Lists]

Re: [xsl] xpath expression restriction

2011-03-04 00:55:18
Hi Andre,
     I'm not sure, but perhaps writing the whole if condition in
braces may force evaluation of the if expression before providing this
operand to operator "gt".

i.e could you please try if following works,

<xsl:copy-of select="abc[position() gt (if ($cond) then 1 else 0)]"/>

also curious to know, what do you write to evaluate $cond?

On Fri, Mar 4, 2011 at 11:22 AM, ac <ac(_at_)hyperbase(_dot_)com> wrote:
Hi,

There must be a reason why I can write

<xsl:variable name="x" select="if ($cond) then 1 else 0"/>
<xsl:copy-of select="abc[position() gt $x]"/>

but not

<xsl:copy-of select="abc[position() gt if ($cond) then 1 else 0]"/>

What is the reason?  Is there any way to avoid having to declare the
variable?

Thank you,

Regards,
Andre



-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--