|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1.1.2. @@[ENV:env_var]@@ : insertion of the value of an environmental variable
Expressions of type ENV: permit insertion of the value of an environmental variable whose name is indicated by the subscription section
Interface
Parameters
1.1.3. @@[VAL:variable]@@ : insertion of the value of a XDFL variable
Expressions of type VAL: permit the value of the named variable indicated in the argument to be retrieved.
Interface
Parameters
1.1.4. @@[BUF:buffer_name]@@ : insertion of the content of a XDFL buffer
Expressions of type VAL: permit the content of the named buffer indicated in the argument to be retrieved.
Interface
Parameters
1.2. Core language functionnalities.1.2.1. * : Common tag parameters
These parameters are available for every XDFL node.
Interface
Parameters
1.2.2. _ALIAS : Active node aliasing
The _ALIAS node assigns a new name for an XDFL node : the aliased node can be accessed using its original name or the alias.
Interface
Parameters
Side effects
Creates an alias for the tag given as parameter.The aliased node can be accessed using its original name or the alias
Samples
Pluggable module loading and aliasing.
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- loadingthe dynamic library -->
<xdfl:_MODULE_LOAD path="../../build/win32.1.0/sampleModuleStreamer_win32.1.0.dll"
/>
<!-- creating alias -->
<xdfl:_ALIAS name="SAMPLE" alias="SAMPLE2"
/>
</XDFL>
1.2.3. _MODULE_LOAD : External module load
The _MODULE_LOAD node loads a dynamic library and imports XDFL nodes from it. Imported nodes can then be used as normal nodes.
Interface
Parameters
Side effects
The library is loaded in the XDFLengine memory space and the XDFL nodes are imported. Imported nodes can then a used as normal nodes.
Comments
Dynamic loading dependencies
If the loaded library is dependant upon other libraries, these libraries must be located in a directory which path is contained in the dynamic libraries search path.
Samples
Pluggable module loading and aliasing.
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- loadingthe dynamic library -->
<xdfl:_MODULE_LOAD path="../../build/win32.1.0/sampleModuleStreamer_win32.1.0.dll"
/>
<!-- creating alias -->
<xdfl:_ALIAS name="SAMPLE" alias="SAMPLE2"
/>
</XDFL>
1.2.4. BUF_GET : Getting the value of named buffer
The BUF_GET node reads the data contained in a named buffer and write it to its output.
Interface
Parameters
Output
The data of the named buffer
Samples
Using BF_GET and BUF_SET
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- création of a first buffer -->
<xdfl:BUF_SET name="buffer1" create="1"
>
<data attribute="value"
>
</xdfl:BUF_SET>
<more_xml_data
/>
</data>
<!-- writting first buffer to output -->
<xdfl:OUTPUT
>
buffer1:
<xdfl:BUF_GET name="buffer1"
/>
</xdfl:OUTPUT>
<!-- creation of a second buffer -->
<xdfl:BUF_SET name="buffer2" create="1"
>
<XML
>
</xdfl:BUF_SET>
<!-- copy the first buffer in the second one -->
<xdfl:BUF_GET name="buffer1"
/>
</XML>
<!-- append data in the first buffer -->
<xdfl:BUF_SET name="buffer1"
>
<even_more_xml
/>
</xdfl:BUF_SET>
<!-- creation of a third buffer -->
<xdfl:BUF_SET name="buffer3" create="1"
/>
<!-- writtung the content o the first buffer in the third one -->
<xdfl:BUF_GET name="buffer1" output="buffer3"
/>
<!-- output second and third buffer -->
<xdfl:OUTPUT
>
</XDFL>
buffer2:
<xdfl:BUF_GET name="buffer2"
/>
buffer3:
<xdfl:BUF_GET name="buffer3"
/>
</xdfl:OUTPUT>
1.2.5. BUF_SET : Writting to a named buffer
The BUF_SET writes its input stream to a named buffer.
Interface
Input
An XML of non-XML stream
Parameters
Output
The input stream
Side effects
Input data is written to the buffer. If create=1, the buffer is previouly created.
Samples
Using BF_GET and BUF_SET
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- création of a first buffer -->
<xdfl:BUF_SET name="buffer1" create="1"
>
<data attribute="value"
>
</xdfl:BUF_SET>
<more_xml_data
/>
</data>
<!-- writting first buffer to output -->
<xdfl:OUTPUT
>
buffer1:
<xdfl:BUF_GET name="buffer1"
/>
</xdfl:OUTPUT>
<!-- creation of a second buffer -->
<xdfl:BUF_SET name="buffer2" create="1"
>
<XML
>
</xdfl:BUF_SET>
<!-- copy the first buffer in the second one -->
<xdfl:BUF_GET name="buffer1"
/>
</XML>
<!-- append data in the first buffer -->
<xdfl:BUF_SET name="buffer1"
>
<even_more_xml
/>
</xdfl:BUF_SET>
<!-- creation of a third buffer -->
<xdfl:BUF_SET name="buffer3" create="1"
/>
<!-- writtung the content o the first buffer in the third one -->
<xdfl:BUF_GET name="buffer1" output="buffer3"
/>
<!-- output second and third buffer -->
<xdfl:OUTPUT
>
</XDFL>
buffer2:
<xdfl:BUF_GET name="buffer2"
/>
buffer3:
<xdfl:BUF_GET name="buffer3"
/>
</xdfl:OUTPUT>
1.2.6. GET : Getting the value of a variable
The GET node reads the value of a variable and outputs it to its output.
Interface
Parameters
Output
The value of the variable
1.2.7. IF : conditionnal execution
This node carries out a comparison between val1 and val2 using the op operator. If the result is 'false', the sub-tree is not activated and generates no stream. If the condition is true, the sub-tree executes normally and the active IF node returns the stream issued by the sub-tree.
Interface
Input
An XML of non-XML stream
Parameters
Output
If the condition is true, the input stream, else, nothing
Samples
Difference beetween IF and PASSIVE
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl">
<xdfl:OUTPUT
>
</XDFL>
<xdfl:PASSIVE
>
<some_xml
>
</xdfl:PASSIVE>
<and_some_more
/>
<!-- This variable will not be taken in consideration -->
<xdfl:VAL name="onevar1" value="data1"
/>
<!-- This block will not be compiled : no error will be sent for this unvalid tag-->
<xdfl:THIS_XDFL_TAG_DOES_NOT_EXIST
/>
</some_xml>
<!-- False condition -->
<xdfl:IF val1="1" val2="0" op="eq"
>
<will_not_be_displayed
>
</xdfl:IF>
<xdfl:VAL name="onevar2" value="data2"
/>
</will_not_be_displayed>
<!-- True condition -->
<xdfl:IF val1="1" val2="1" op="eq"
>
<will_be_displayed
>
</xdfl:IF>
<xdfl:VAL name="onevar3" value="data3"
/>
</will_be_displayed>
onevar1 : @@[VAL:onevar1]@@ onevar2 : @@[VAL:onevar2]@@ onevar3 : @@[VAL:onevar3]@@</xdfl:OUTPUT> 1.2.8. LOG : Stream interception / logging
This active node enables a stream to be intercepted and written to a log file.
Interface
Input
An XML of non-XML stream
Output
The input stream
Side effects
Writes the input stream to log
Samples
Using LOG, INPUT and OUTPUT
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- 3/ Outputing input data -->
<xdfl:OUTPUT
>
</XDFL>
<!-- 2/ Logging input data -->
<xdfl:LOG
>
</xdfl:OUTPUT>
<!--1/ Getting input data -->
<xdfl:INPUT
/>
</xdfl:LOG>
1.2.9. NULL : 'nop' tag
The NULL tag does nothing and outputs the data it receives in input.
Interface
Input
An XML of non-XML stream
Output
The input stream
Samples
Using NULL
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- creating a buffer -->
<xdfl:BUF_SET name="buffer" create="1"
/>
<xdfl:OUTPUT
>
</XDFL>
<xdfl:NULL
>
<some_xml
>
</xdfl:NULL>
<blah
/>
...
<blah
/>
...
<blah
/>
</some_xml>
<!-- writting to the buffer -->
<xdfl:NULL output="buffer"
>
<some_more_xml
>
</xdfl:NULL>
<data
/>
</some_more_xml>
<!-- output buffer's content --> buffer:
<xdfl:BUF_GET name="buffer"
/>
</xdfl:OUTPUT>
1.2.10. RAISE_ERROR : Error raising
The RAISE_ERROR node raises an error
Interface
Parameters
Side effects
If the error number is anything other than 0, the error with the specified number is raised, with the specified message.
Samples
Raising an error
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- Raising an error -->
<xdfl:RAISE_ERROR number="666" message="Catastrophic failure"
/>
</XDFL>
Catching an error
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl">
<xdfl:BUF_SET name="error_buffer" create="1"
/>
<!-- The NULL tag allows to catch the error -->
<xdfl:NULL error_fatal="0" output_error="error_buffer"
>
<!--The VAL node expects an input document --> <!-- Finding two nodes, it will raise an error -->
<xdfl:VAL
>
</xdfl:NULL>
<docroot1
/>
<docroot2
/>
</xdfl:VAL>
<!-- Getting values from error buffer -->
<xdfl:VAL
>
<xdfl:BUF_GET name="error_buffer"
/>
</xdfl:VAL>
<xdfl:OUTPUT
>
</XDFL>
<xdfl:BUF_GET name="error_buffer"
/>
The error Nb:@@[VAL:ERROR.number]@@ has occured : @@[VAL:ERROR.message]@@</xdfl:OUTPUT> 1.2.11. RAW : Raw content extraction
The RAW node returns only the text content found in the XML tree supplied as input.
Interface
Input
An XML stream.
Output
The textual content found in input stream (TEXT and CDATA sections).
1.2.12. SPLIT : Iteration on child nodes in an XML document
The SPLIT node repeats the execution of the immediate parent node for each subtree of the input XML stream at specified depth.Each documents sent to the parent node consists in the subtree and its ancestors.
Interface
Input
An XML stream.
Parameters
Output
As many XML streams are there are subtrees at specified level.
Side effects
The execution of the immediate parent node is repeated for each subtree of the XML input stream.
1.2.13. SEQUENCE : Repeated execution of child nodes.
The SEQUENCE node produces a sequence of XML tags and repeats the execution of the immediate parent node.
Interface
Parameters
Output
A iteration number='n'/ XML tag is generated for each iteration.
Side effects
When split=1 the execution of the immediate parent node is repeated for each iteration.
Samples
Executing system command
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl">
<xdfl:_MODULE_COMPILE name="testmod"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<xdfl:OUTPUT
>
</xdfl:NULL>
<blah
>
</xdfl:OUTPUT>
<xdfl:INPUT
/>
</blah>
<xdfl:MODULE_EXEC name="testmod"
>
</XDFL>
<xdfl:SEQUENCE min="1" wait="2000" step="2"
/>
</xdfl:MODULE_EXEC>
1.2.14. SYSTEM : System calls
The SYSTEM node enables the execution of system commands inserted into an XML stream. The content of each TEXT or CDATA section is executed as a system command
Interface
Input
An XML stream
Output
The input stream, with system calls contained in TEXT or CDATA sections replaced by their return value.
Side effects
Executes the system commands contained in TEXT and CDATA sections
Samples
Executing system command
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl">
<xdfl:OUTPUT
>
</XDFL>
<xdfl:SYSTEM
>
</xdfl:OUTPUT>
<commands
>
</xdfl:SYSTEM>
<!-- display system's version -->
<command
>
ver</command> <!-- display date -->
<command
>
</commands>
date /T</command> 1.2.15. VAL : Generation of variables
If a name/value pair is provided a variable is generated with the specified name and the specified value.
If an XML input stream is provided.The SPLIT node generates variables from the input XML stream for each TEXT section, CDATA section and each attribute. The name of the generated variable is the XPATH path to the section or the attribute, where slashed are replaced by dots.
Interface
Input
An XML stream.
Parameters
Output
The input XML stream.
Side effects
Variables are generated according to the input XML stream and arguments.
Samples
Assigning variables from name/values pairs
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- set 'myvar' to 'valeur1' -->
<xdfl:VAL name="myvar1" value="valeur1"
/>
<!-- set 'myvar2' to the value of 'myvar1' -->
<xdfl:VAL name="myvar2" value="@@[VAL:myvar1]@@"
/>
<!-- output variables values -->
<xdfl:OUTPUT
>
</XDFL>
myvar1 :
<xdfl:GET val="myvar2"
/>
myvar2 : @@[VAL:myvar2]@@</xdfl:OUTPUT> Assigning variables from an input stream
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- assigning variables from a stream -->
<xdfl:VAL list="1"
>
<a
>
</xdfl:VAL>
<b
>
valeur1</b>
<c attr="valeur2"
>
valeur3</c>
<b
>
</a>
valeur4</b> <!-- output variables values -->
<xdfl:OUTPUT
>
</XDFL>
a.b : @@[VAL:a.b]@@ a.c.@attr : @@[VAL:a.c.@attr]@@ a.c : @@[VAL:a.c]@@</xdfl:OUTPUT> 1.3. Access to file and folders.1.3.1. FS_FIND : File and directories searching / listing.
The FS_FIND node list the directories and files matching a path and mask.
Interface
Parameters
Output
XML tree listing returned items.
Samples
(simple) UNIX find, XML flavor
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl">
<xdfl:OUTPUT
>
</XDFL>
<xdfl:FS_FIND path="@@[VAL:ARG.path]@@" recurse="1" glob="@@[VAL:ARG.match]@@"
/>
</xdfl:OUTPUT>
1.3.2. FS_GET : Reading from file.
The FS_GET node reads data from a file and outputs it to output stream.
Interface
Parameters
Output
Data read from file.
Samples
File copy
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!--Read the input file, write to output -->
<xdfl:FS_SET target="@@[VAL:ARG.dest]@@"
>
<xdfl:FS_GET target="@@[VAL:ARG.org]@@"
/>
</xdfl:FS_SET>
<xdfl:OUTPUT
>
</XDFL>
File @@[VAL:ARG.org]@@ Copied to @@[VAL:ARG.dest]@@</xdfl:OUTPUT> 1.3.3. FS_SET : Writting to file
The FS_SET node writes input stream to specified file.
Interface
Input
An XML or non-XML stream.
Parameters
Output
The input stream.
Side effects
The input stream is written to destination file, or the file is deleted.
Samples
File copy
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!--Read the input file, write to output -->
<xdfl:FS_SET target="@@[VAL:ARG.dest]@@"
>
<xdfl:FS_GET target="@@[VAL:ARG.org]@@"
/>
</xdfl:FS_SET>
<xdfl:OUTPUT
>
</XDFL>
File @@[VAL:ARG.org]@@ Copied to @@[VAL:ARG.dest]@@</xdfl:OUTPUT> 1.4. Definition of modules and classes, invocation of functions, creation of objects.1.4.1. _CLASS_DECLARE : Declaration of a class
The _CLASS_DECLARE node creatés a new class. The input stream can be used as a parameter of the class definition.
Interface
Input
An XML or non-XML stream. The input stream can be used as a parameter of the class definition.
Parameters
Output
Depends on the class initialization function.
Side effects
The new class is created. Modules can be added to this class and objects can be created from this class.
Samples
Class declarion, modules and heritage
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- Class 1 -->
<xdfl:_CLASS_DECLARE class="class1"
/>
<xdfl:_MODULE_COMPILE class="class1" name="moduleA"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<xdfl:MODULE_EXEC name="moduleB"
>
</xdfl:NULL>
<xdfl:INPUT
/>
</xdfl:MODULE_EXEC>
<xdfl:_MODULE_COMPILE class="class1" name="moduleB"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<class1
>
</xdfl:NULL>
<xdfl:INPUT
/>
</class1>
<!-- Class 2 -->
<xdfl:_CLASS_DECLARE class="class2" extends="class1"
/>
<xdfl:_MODULE_COMPILE class="class2" name="moduleB"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<class2
>
</xdfl:NULL>
<xdfl:INPUT
/>
</class2>
<xdfl:_MODULE_COMPILE class="class2" name="moduleC"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<xdfl:MODULE_EXEC ancestor="class1" name="moduleB"
>
</xdfl:NULL>
<xdfl:INPUT
/>
</xdfl:MODULE_EXEC>
<!-- Execution -->
<xdfl:OUTPUT
>
</XDFL>
<xdfl:MODULE_EXEC class="class1" name="moduleA"
>
<class1_module_a
/>
</xdfl:MODULE_EXEC>
<xdfl:MODULE_EXEC class="class2" name="moduleA"
>
<class2_module_a
/>
</xdfl:MODULE_EXEC>
<xdfl:MODULE_EXEC class="class2" name="moduleC"
>
</xdfl:OUTPUT>
<class2_module_c
/>
</xdfl:MODULE_EXEC>
1.4.2. _MODULE_COMPILE : Compiles a new module on an existing class.
the _MODULE_COMPILE node compiles a new module (ie method or function) and adds it to the specified class.
Interface
Input
The XDFL script to be compiled as a module. The input is usually given as a PASSIVE stream, so it is not interpreted before being compiled.
Parameters
Side effects
The new module is compiled and added to the class. The module can then be called.
Comments
Defining the constructor of a class
If a module is compiled with the name 'init' on a class, it is the constructor of that class. This module is be called after every object creation.
Samples
Compiling and executing modules
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- Compilation du module -->
<xdfl:_MODULE_COMPILE name="gen_enveloppe"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<xdfl:IF val1="@@[VAL:ARG.type]@@" val2="XML"
>
<XML
>
</xdfl:IF>
<xdfl:INPUT
/>
</XML>
<xdfl:IF val1="@@[VAL:ARG.type]@@" val2="DATA"
>
</xdfl:NULL>
<DATA
>
</xdfl:IF>
<xdfl:INPUT
/>
</DATA>
<!-- exécution -->
<xdfl:OUTPUT
>
</XDFL>
<xdfl:MODULE_EXEC name="gen_enveloppe" type="DATA"
>
</xdfl:OUTPUT>
<xdfl:MODULE_EXEC name="gen_enveloppe" type="XML"
>
</xdfl:MODULE_EXEC>
<some_xml
>
</xdfl:MODULE_EXEC>
<data
/>
</some_xml>
1.4.3. CLASS_CREATEOBJECT : Creation of an object from a class.
The CLASS_CREATEOBJECT create a new object from the indicated class. If the class provies a constructor, it is called after object creation.
Interface
Input
An XML or Non-XML stream. The input stream is passed as argument to the constructor.
Parameters
Output
]The output stream is the stream returned by the constructor.
Side effects
The object is created and stored in current context. The object conists in a special context named 'OBJECT'.
Samples
Using objects
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- Class 1 -->
<xdfl:_CLASS_DECLARE class="class1"
/>
<xdfl:_MODULE_COMPILE class="class1" name="init"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<xdfl:BUF_SET context="OBJECT" create="1" name="object_buffer"
>
<xdfl:INPUT
/>
</xdfl:BUF_SET>
<xdfl:VAL context="OBJECT" name="prop" value="(NULL)"
/>
</xdfl:NULL>
<xdfl:_MODULE_COMPILE class="class1" name="set_prop"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<xdfl:VAL context="OBJECT" name="prop" value="@@[VAL:ARG.val]@@"
/>
</xdfl:NULL>
<xdfl:_MODULE_COMPILE class="class1" name="get_data"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<xdfl:BUF_GET name="object_buffer"
/>
</xdfl:NULL>
<xdfl:_MODULE_COMPILE class="class1" name="get_xml"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<object_class1 prop="@@[VAL:prop]@@"
>
</xdfl:NULL>
<xdfl:MODULE_EXEC name="get_data"
/>
</object_class1>
<!-- object1 -->
<xdfl:CLASS_CREATEOBJECT class="class1" object="object1"
>
<object1
>
</xdfl:CLASS_CREATEOBJECT>
<data
/>
</object1>
<xdfl:MODULE_EXEC object="object1" name="set_prop" val="1"
/>
<!-- Execution -->
<xdfl:OUTPUT
>
</XDFL>
<xdfl:MODULE_EXEC object="object1" name="get_xml"
/>
object1/prop:@@[VAL:object1/prop]@@</xdfl:OUTPUT> 1.4.4. MODULE_EXEC : Invocation of a module.
The MODULE_EXEC node calls a module on as a static mathod of a class or as a method of an existing object.
Interface
Input
An XML or Non-XML stream. The input stream is passed as argument to the module.
Parameters
Output
]The output stream is the stream returned by the module.
Side effects
Depends on the module.
Samples
Compiling and executing modules
<?xml version="1.0" encoding="ISO-8859-1"?>
<XDFL xmlns:xdfl="xdfl"> <!-- Compilation of the module -->
<xdfl:_MODULE_COMPILE name="gen_enveloppe"
>
<xdfl:PASSIVE
>
</xdfl:_MODULE_COMPILE>
<xdfl:NULL
>
</xdfl:PASSIVE>
<xdfl:IF val1="@@[VAL:ARG.type]@@" val2="XML"
>
<XML
>
</xdfl:IF>
<xdfl:INPUT
/>
</XML>
<xdfl:IF val1="@@[VAL:ARG.type]@@" val2="DATA"
>
</xdfl:NULL>
<DATA
>
</xdfl:IF>
<xdfl:INPUT
/>
</DATA>
<!-- execution -->
<xdfl:OUTPUT
>
</XDFL>
<xdfl:MODULE_EXEC name="gen_enveloppe" type="DATA"
>
</xdfl:OUTPUT>
<xdfl:MODULE_EXEC name="gen_enveloppe" type="XML"
>
</xdfl:MODULE_EXEC>
<some_xml
>
</xdfl:MODULE_EXEC>
<data
/>
</some_xml>
1.4.5. SCRIPT_EXEC : Execution of a XDFL script.
The SCRIPT_EXEC compiles and executes a XDFL script provided as input stream, as a buffer or as a file.
Interface
Input
Nothing or a XDFL script.
Parameters
Output
The stream returned bu the execution of the script.
Side effects
Depends on the script.
II. javascript
|
Name | Type | Description | ||||||
call* | string | The name of the function to call | ||||||
parse_dom | boolean | Indicates whether to use jsMicroDOM or not.
|
<!-- compilation d'un script JS -->
function sumOrders() { try{ xmlOrderEntries = XDFL.selectNodes( XDFL.XMLinput(),"mcrm_client/mcrm_order/mcrm_order_entry") intNumOrders = xmlOrderEntries.length intTotalPrice = 0 for(i=0; i != intNumOrders-1; i++) { xmlOrderEntry = xmlOrderEntries[i] XDFL.log(xmlOrderEntry.getAttribute("fk_order")) intPrice = XDFL.selectSingleNode(xmlOrderEntry, "mcrm_product/price").nodeValue intQuant = XDFL.selectSingleNode(xmlOrderEntry, "quantity").nodeValue intTotalPrice += intPrice*intQuant } intAvgPrice = intTotalPrice / intNumOrders xmlOutputTotal=new XMLDOMElement("XML") xmlOutputTotal.appendChild(new XMLDOMElement("total")).nodeValue = intTotalPrice xmlOutputTotal.appendChild(new XMLDOMElement("number")).nodeValue = intNumOrders xmlOutputTotal.appendChild(new XMLDOMElement("average")).nodeValue = intAvgPrice XDFL.outputXML( xmlOutputTotal) } catch(e){XDFL.log(e)} }</xdfl:JS_COMPILE>
<!-- Execution ... -->
Name | Type | Description |
name* | string | The name of the compiled sheet. |
<!-- Read and compile the xsl sheet from a file -->
<!-- Transform input using compiled sheet, output result -->
Name | Type | Description | ||||||
name* | string | The name of the compiled sheet. | ||||||
append-header | boolean | Indicates whether append a XML header to the input document.
|
<!-- Read and compile the xsl sheet from a file -->
<!-- Transform input using compiled sheet, output result -->
Name | Type | Description | ||||||
path* | string | the xpath request to use. | ||||||
append-header | boolean | Indicates whether append a XML header to the input document.
|
Name | Type | Description | ||||||
connection* | string | The connection string to the database. | ||||||
statement* | string | The SQL statement to execute. | ||||||
enclose_record | string | The name of the tag used to enclose each outputed records.
|
||||||
flushrecords | integer | Number to records to output at once.
|
||||||
streamrecords | integer | Number to records send to to stream at once.
|
||||||
commitrecords | integer | Number to records to commit at once.
|
||||||
buffersize | integer | Number of records bufferized before being sent to DB
|
||||||
dberror_fatal | boolean | Indicates whether a DB error stops the execution of the node or not.
|
||||||
transmit_data | boolean | Forces the node to behave as a transparent node.
|
||||||
lowercase | boolean | Lowercase outputed XML tags.
|
||||||
filter_columns | string | Filter clause for the columns in the input data set. If this parameter is empty or absent, the processor attempts to link all values found in the query.If this parameter has the value (auto), data in the input data set are linked to the query by comparing the name in the XML stream to the name of the linked variable. If this parameter is a list of names, only data from the data set mentioned in the list is linked.
|
Name | Type | Description | ||||||
connection* | string | The connection string to the database. | ||||||
expand_fields | boolean | Indicates whether columns of the table which are not present in the definition should be added or not.
|
Name | Type | Description |
name* | string | The name of the compiled definition |
Name | Type | Description | ||||||
connection* | string | The connection string to the database. | ||||||
target* | string | The name of the compiled DB object definition to use. | ||||||
flat | boolean | Extracts only the root node of the objects
|
||||||
maxitems | integer | The maximum number of objects to extract. Using this parameters sets flat parameter to '1'.
|
||||||
streamobjects | integer | Number to objects to send to stream at once.
|
||||||
buffersize | integer | Number of SQL requests bufferized before being sent to DB
|
@@[VAL:ARG.id]@@</filter>
Name | Type | Description | ||||||||||
connection* | string | The connection string to the database. | ||||||||||
target* | string | The name of the compiled DB object definition to use. | ||||||||||
action | string | The action to perform on objects.
|
||||||||||
commitobjects | integer | Number to objects commit at once in database.
|
||||||||||
streamobjects | integer | Number to objects to send to stream at once.
|
||||||||||
buffersize | integer | Number of SQL requests bufferized before being sent to DB
|
||||||||||
dberror_fatal | boolean | Indicates whether a DB error stops the execution of the node or not.
|
||||||||||
output_dberror | string | Name of buffer to output DB generated errors in.
|
||||||||||
output_reject | string | Name of buffer to output objects whch caused an error in.
|
||||||||||
output_report | string | Name of buffer to output actions report in.
|
||||||||||
count | boolean | Indicates whether to count actions for each node of the objects in the actions report.
|
Name | Type | Description |
query | string | SQL query to execute |
Name | Type | Description |
path | string | XPATH query |
Name | Type | Description | ||||||
server | string | The address of the SMTP server used.
|
||||||
port | integer | The SMTP port of the server.
|
||||||
username | string | The user name used to anthenticate on the server. | ||||||
password | string | The password used to authenticate on the server. | ||||||
mxlookup | string | Indicates whether to query MX record.
|
sender@domain.com</from>
recipient@another-domain.org</to>
another-recipient@another-domain.biz</to>
carbon-copy@another-domain.net</cc>
blind-carbon-copy@another-domain.net</bcc>
The subject of the mail</subject>
A plain text message body</body>
path/to/attached/file</attach>
path/to/other/attached/file</attach>
sender@domain.com</from>
recipient@another-domain.org</to>
carbon-copy@another-domain.net</cc>
blind-carbon-copy@another-domain.net</bcc>
The subject of the second mail</subject>
A plain text message body for the second mail</body>
path/to/attached/file</attach>
Name | Type | Description | ||||
target* | string | Path of the source file. | ||||
streamdata | integer | Size of each data packet sent to output, in bytes.
|
<!--Read the input file, write to output -->
File @@[VAL:ARG.org]@@ Unzippped to @@[VAL:ARG.dest]@@</xdfl:OUTPUT>
Name | Type | Description | ||||||||
target* | string | The path of the destination file. | ||||||||
header | string | String to be written at he beginning of the file. | ||||||||
action | string | Indicates an action to be performed on the file.
|
<!--Read the input file, write to output -->
File @@[VAL:ARG.org]@@ zipped to @@[VAL:ARG.dest]@@</xdfl:OUTPUT>
<!-- language code: EN -->
SAMPLE TITLE</title>
Need help?</help>
Server unavailable</err_1>
Invalid data</err_2>
<!-- language code: FR -->
TITRE D'EXEMPLE</title>
Vous avez besoin d'aide ?</help>
Le serveur est indisponible</err_1>
Les données sont inconrrectes</err_2>
@@[LANG:labels.title]@@ : @@[LANG:labels.help]@@</xdfl:OUTPUT>
Name | Type | Description |
code* | string | Language code to use for current script. |
<!-- language code: EN -->
SAMPLE TITLE</title>
Need help?</help>
Server unavailable</err_1>
Invalid data</err_2>
<!-- language code: FR -->
TITRE D'EXEMPLE</title>
Vous avez besoin d'aide ?</help>
Le serveur est indisponible</err_1>
Les données sont inconrrectes</err_2>
@@[LANG:labels.title]@@ : @@[LANG:labels.help]@@</xdfl:OUTPUT>
Name | Type | Description |
dictionary_entry_name | string | Indicates the name the dictionnary entry to insert |
Name | Type | Description | ||||
key* | string | The encryption key used. | ||||
algo* | string | The encryption algorithm used.
|