In the file/FTP adapter, you can use variables in the entries for the target directory and file name scheme. The variables can refer to either attributes in the message header or elements in the XML schema of the message payload.
You are defining a receiver file adapter or a receiver FTP adapter.
An example of an entry for the target directory using variables is: c:/temp/local/%var1%
The variables can refer to attributes of the message header or elements of the message payload.
Defining Variables for Attributes in the Message Header
You can specify the following attributes of the message header:
For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
Defining Variables for Elements in the XML Schema of the Payload
The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
namea,nameb,...corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
The description begins at the root of the document and ends at the respective element.
For example, to reference the element that is in bold in the XML structure below, the following expression is used: payload:root,1,e1,1,e2,2
The parser searches for the first occurrence of the root element at the first level.
It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2at the third level.
The content of the last element (" Example Value ") is set as the value for a specified variable.
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<dummy>
<e1>
<e2>Data_1</e2>
<f/>
<g attr="abc">text</g>
<e2>Data_2</e2>
</e1>
</dummy>
<e1>
<e2>illegal/value</e2>
<f/>
<g attr="abc">text</g>
<e2 attr="fghij">Example Value</e2>
</e1>
</root>
Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters "/", "\", and "..".