Actions
Feature #5558
openadd XPath function build_xpath()
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="site"]])]', 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}
Updated by Reynaud Sylvain about 11 years ago
- Subject changed from add XPath function eval_arguments() to add XPath function build_xpath()
- Description updated (diff)
Actions