Feature #5558

add XPath function build_xpath()

Added by Reynaud Sylvain over 6 years ago. Updated over 6 years ago.

Status:NewStart date:11/22/2013
Priority:LowDue date:
Assigned To:-% Done:

0%

Category:Engine
Target version:maybe

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}

History

#1 Updated by Reynaud Sylvain over 6 years ago

  • Description updated (diff)

#2 Updated by Reynaud Sylvain over 6 years ago

  • Subject changed from add XPath function eval_arguments() to add XPath function build_xpath()
  • Description updated (diff)

#3 Updated by Reynaud Sylvain over 6 years ago

  • Target version set to maybe

Also available in: Atom PDF