Project

General

Profile

Feature #5013

Updated by Reynaud Sylvain about 11 years ago

+Refactoring steps+: 
 1) make all <processor> extends <code>AbstractSAXPathProcessor</code>. supporting straxpath. 
 2) support new syntax: 

  * develop XSL to translate new syntax to current syntax (for pre-processing). 
  * develop XSL to translate current syntax to new syntax (for lavoisier-update-config.sh). 

 3) support Lavoisier modify interfaces and engine (share XPath functions in PiXTL short notation (modify XSL to translate PiXTL short notation to new syntax). management, create a 2nd implementation of interface Configuration, ...). 
 3) simplify <processors>. 
 4) support new syntax hidden parameters 

  * modify XSL to generate hidden parameters. 
  * instanciate plug-in from new syntax. language. 

 5) refactoring: move AbstractSAXPathProcessor to engine: 

  * modify adaptor interfaces. 
  * modify engine. 


 +Language modifications+: 
 * replace parameter "nodes" with attribute @match. 
 * replace parameter "namespaces" with xmlns:ns. 
 * replace parameters "variables" and "xml_variables" with <variable isXML="true|FALSE"/>. 
 * support all XPath functions in both context, except function matched(). 

 +Pre-processing steps+: 
 1) convert XPath to XML tree <eval>. 
 2) optimize: 

 * move the XPath functions that have no descendant::RelativeLocationPath (nor path relative to function matched()) to variables. 
 * add attribute @onEvents to <parameter>. 
 * convert XML tree <eval> to XPath @eval. 

 +Example with actual notation+: 
 <pre><code class="xml"> 
 <processor type="ReplaceProcessor"> 
     <parameter name="namespaces"> 
         <entry key="e">http://software.in2p3.fr/lavoisier/entries.xsd</entry> 
     </parameter> 
     <parameter name="variables"> 
         <entry key="prefix" eval="path('prefix')"/> 
     </parameter> 
     <parameter name="xml_variables"> 
         <entry key="xml" eval="request()"/> 
     </parameter> 
     <parameter name="nodes">/e:entries/e:entry[@key &lt; $xml/@value]</parameter> 
     <parameter name="node_value">'1'</parameter> 
     <parameter name="node_name">concat(path('prefix'),'-',text())</parameter> 
     <parameter name="node_name_as_xpath">true</parameter> 
 </processor> 
 </code></pre> 

 +The same example with target notation+: 
 <pre><code class="xml"> 
 <processor type="ReplaceProcessor" xmlns:e="http://software.in2p3.fr/lavoisier/entries.xsd" 
            context="/e:entries/e:entry[@key &lt; request()/@value]"> 
     <parameter name="node_name" eval="concat(path('prefix'),'-',text())"/> 
     <parameter name="node_value">1</parameter> 
 </processor> 
 </code></pre> 

 +Main benefits+: 
 * less verbose. 
 * same XPath functions in both contexts. 
 * any parameter can be evaluated as an XPath expression.

Back