configurationengine/doc/plugins/templateml-plugin/templatemlplugin.rst
changeset 3 e7e0ae78773e
parent 0 2e8eeb919028
child 4 0951727b8815
equal deleted inserted replaced
2:87cfa131b535 3:e7e0ae78773e
    70   <desc>Description field text</desc>
    70   <desc>Description field text</desc>
    71 
    71 
    72 output element
    72 output element
    73 **************************
    73 **************************
    74 
    74 
    75 Output element describes how one output file is generated. Output has one mandatory attribute 'file' that defines filename for output file. If you want to generate output file to some other than default folder, it can be done by defining a output directory to 'dir' attribute. Default encoding for output file is 'UTF-8', if some other encoding is wanted, it can be defined by 'encoding' attribute.  This encoding should be one of the standard Python codecs encoding (see http://docs.python.org/library/codecs.html#standard-encodings).
    75 Output element describes how one output file is generated. Output has one mandatory attribute 'file' that defines filename for output file. If you want to generate output file to some other than default folder, it can be done by defining a output directory to 'dir' attribute. Default encoding for output file is 'UTF-8', if some other encoding is wanted, it can be defined by 'encoding' attribute.  This encoding should be one of the standard Python codecs encoding (see http://docs.python.org/library/codecs.html#standard-encodings). By 'newline' attribute the output file's newline characters can be defined. The default value is 'unix' that use LF (Line feed, '\n', 0x0A) in output file. LF is used Unix-like systems and web applications. If output file has to use CR (Carriage Return) followed by LF (CR+LF, '\r\n', 0x0D 0x0A) as newline characters, 'newline' attribute should have value 'win'. CR+LF is used in non-Unix systems like DOS, Windows and Symbian OS.
    76 
    76 
    77 Template element is mandatory child element for output element. One output element can have only one template element.
    77 Template element is mandatory child element for output element. One output element can have only one template element.
    78 Output element can also contain optional filter elements that are specific just for this output file. Global filters that are common for all output files should be defined under root templateml element. 
    78 Output element can also contain optional filter elements that are specific just for this output file. Global filters that are common for all output files should be defined under root templateml element. 
    79 
    79 
    80 **output example**:
    80 **output example**:
    81 
    81 
    82 .. code-block:: xml
    82 .. code-block:: xml
    83 
    83 
    84   <output file="my_output.txt" encoding="UTF-8" dir="output">
    84   <output file="my_output.txt" encoding="UTF-8" dir="output" newline="win">
    85     <template>Hello world!</template>
    85     <template>Hello world!</template>
    86     <filter name="filter1">lambda a,b: a+b</filter>
    86     <filter name="filter1">lambda a,b: a+b</filter>
    87     <filter name="filter2">lambda a,b: a*b</filter>
    87     <filter name="filter2">lambda a,b: a*b</filter>
    88   </output>
    88   </output>
    89 
    89