Project

General

Profile

Actions

Feature #5558

open

add XPath function build_xpath()

Added by Reynaud Sylvain almost 11 years ago. Updated almost 11 years ago.

Status:
New
Priority:
Low
Assigned To:
-
Category:
Engine
Target version:
Start date:
11/22/2013
Due date:
% Done:

0%

Estimated time:

Description

<view name="v">
    <argument name="site">NONE</argument>
    <connector type="XMLConnector">
        <parameter name="content">
            <entry key="CC-IN2P3">Lyon</entry>
            <entry key="LAPP">Annecy</entry>
            <entry key="CERN">Geneve</entry>
        </parameter>
    </connector>
    <processors>
        <!-- the less flexible solution (the XPath is fixed in the view) -->
        <processor type="SelectProcessor" match="/*/*[@key=$site]" disabled="$site='NONE'"/>
    </processors>
</view>

<!-- the less efficient solution (requires a data structure to be built) -->
<parameter eval="view('v')/*/*[@key=$site]"/>

<!-- argument 'site' is evaluated by view 'v' -->
<parameter eval="view('v/*/*[@key=$site]', arguments())"/><!-- view 'v' must have <argument name="site"/> -->
<parameter eval="view('v/*/*[@key=arguments()[@key=&quot;site&quot;]])]', arguments())"/>

<!-- argument 'site' is evaluated by current view -->
<parameter eval="view(concat('v/*/*[@key=',quot($site),']'))"/>
<parameter eval="view(build_xpath('v/*/*[@key={$site}'))"/> 

Note: build_xpath() must disable optimizer for {match()/@id}

Actions

Also available in: Atom PDF