W3C home > Mailing lists > Public > xproc-dev@w3.org > May 2012

Re: Referencing an XProc variable in p:split-sequence/@test

From: Florent Georges <fgeorges@fgeorges.org>
Date: Mon, 7 May 2012 16:18:06 +0200
Message-ID: <CADyR_r2R=ZodzapBge4B1hUsgQ1zE27Q3dbiuD6QwbNvoQhwbg@mail.gmail.com>
To: vojtech.toman@emc.com
Cc: xproc-dev@w3.org
On 7 May 2012 16:05, ? wrote:

> the 'test' XPath expression is evaluated using the step XPath context

  Damn, I forgot about this one...  Thanks!

> A solution is to do something like this:

> <p:split-sequence>
>  <p:with-option name="test" select="concat(' name(/*) eq '",$elem,"')"/>
> </p:split-sequence>

  I such cases, I always use replace() like the following, in order to
ensure well-formed XPath expressions:

    <p:with-option name="test" select="
        concat(' name(/*) eq '", replace($elem, '''', ''''''), "')"/>

  But that makes pretty unreadable expressions...

  Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
Received on Monday, 7 May 2012 14:19:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 May 2012 14:19:00 GMT