Re: p:split-sequence gives "Undeclared variable in XPath expression"

On 16 August 2011 15:51, Jostein Austvik Jacobsen wrote:

  Hi,

>     <p:split-sequence test="$option"/>

> This fails with the message "Undeclared variable in XPath
> expression: $option".  If I replace test="$option" with either
> test="true()" or test="position()=1" it works.  But when I
> introduce a variable or option into the test, it fails.  So
> what am I missing here?

  The *value* of the test option is defined to be an XPath
expression, evaluated at some point by the processor.  This is
different than an XPath expression evaluated by the processor at
the lexical point where it appears (for instance when using
p:with-option).  Compare it to:

    <p:split-sequence>
       <p:with-option name="test" select="'true()'"/>
    </p:split-sequence>

  Regards,

-- 
Florent Georges
http://fgeorges.org/

Received on Tuesday, 16 August 2011 14:06:33 UTC