XML Script logo
Command _eval
Attribute

interpolate, a string

[optional] whether to explicitly search for interpolations in the incoming data.

Attribute

csv, a string

[optional] whether the input is treated as CSV (comma separated values), yes|no.

Attribute

result, a string, defaults to 'exec'

[optional] over-rides the values of the 'persist' and 'repeat' attributes, code|data|exec|temp.

Attribute

persist, a string

[optional] whether the output persists, yes|no.

Attribute

repeat, a string

[optional] whether to allow repeated processing of this tag, yes|no.

Attribute

file, a string

[optional] the name of the file to be imported.

Description

The <_data /> and <_eval /> tags are both used to handle pieces of data, and have a number of common features. If there is a 'file' attribute, the contents of the specified file will be imported; otherwise, the tag will operate on its own contents. The 'csv' attribute, if set to 'yes' allows the input to be treated as CSV format. Both tags parse the data as XML but only the <_eval /> tag processes it as well. By default the <_data/ > command will not check the incoming text for interpolations but the <_eval /> command will. this can be overridden using the 'interpolation' attribute. If set to 'yes', interpolations will be checked for, if set to 'no' they will be ignored. The 'repeat' attribute may be used to specify whether the tag itself persists after it has been first processed. If 'repeat' is set to 'no', the tag will not persist after its first evaluation, in other words, it will be processed only once. The default value for repeat is 'yes'. The 'persist' attribute may be used to specify whether the output of the tag is to persist in the XML tree after the current template finishes processing. If this attribute is set to 'yes' then the output will remain on the XML tree, and will still be visible if and when that template is next invoked. the default value for 'persists' if not set is 'yes'. The 'result' attribute sets both the 'repeat' and 'persist' attributes overriding values assigned and also sets whether the output is on the data or template side of the tree. If 'result' is set to 'temp' or 'data', the output will be on the data side. If 'result' is set to 'code' (or in _eval, 'exec') then the output will be on the template side. If 'result' is set to 'data' or 'code' then 'persist' is set to 'yes'. If it is set to 'temp' (or in _eval, 'exec') then the output will not persist. 'Result' also sets 'repeat'to 'yes' except in _eval when 'result' is set to 'code' when the tag will not persist after the first evaluation.
To summarise when 'result' is set to 'temp' or 'data' both send output to the data side, but 'temp' is removed again when the current template finishes. When 'result' is set to 'exec' (in _eval)and 'code', the output is on the template side, but in 'exec' is not permanent.

Examples of use

                                
                        

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited