XMLMemSaveTemplateParserUnit

Class name

com.ebd.hub.datawizard.iu.XMLMemSaveTemplateParserUnit


Important note: Please use the XMLNoTemplateUnit for newly developed profiles.

This Integration Unit works like the XMLTemplateParserUnit (the use of templates is explained there), but uses a temporary file to save main memory. Additionally, text attributes can be encoded with Base64. With the additional parameter Write mandatory empty field=true, the Integration Unit will create elements for mandatory empty fields, even if the parameter with empty fields=false.

The use of variables (in the notation @VAR_NAME@) in the template file (outside of a DataWizardSection), and the dynamic naming of XML elements is possible. CDATA elements are supported as well.

The XMLMemSaveTemplateParserUnit allows to dynamically name XML elements by using the value of a field as the element name. Assume that a target structure field has the name xy2 and in the XML template file an XML element is defined with the placeholder __VALUE_xy2_EULAV__. In that case, the placeholder will be replaced with the current value of field xy2 at runtime. The usual placeholder syntax @fieldname@ found at other places in the XML template file and using prefix and suffix @, cannot be used in this specific situation, because the name of an XML element must not contain special characters like @ or #. Therefore __VALUE_ (double underscore at the beginning) is used as prefix and the same character string reversed as suffix. The field name itself is not allowed to contain # either and needs to be renamed if it does.

The optional attribute onlyRecord controls if a node is only output for a certain record. The attribute has to be manually added to the template file. As an example <DataWizardSection node="OrderHeader" onlyRecord="1"> would only output the node OrderHeader for the first record, onlyRecord="2" only for the second, onlyRecord="-1" only for the last, and onlyRecord="-2" only for the second to the last.

Parameters


Parameter

Allowed values

Default value

Description

Do not encode quote and apos char

true, false

false

If true, quote and apostrophe characters will not be encoded.

Encode content with Base64

true, false

false

If true, text attributes will be Base64 encoded.

Insert this DOCTYPE declaration



DOCTYPE to be inserted. Note: If you want to use an XML header other than the default header <?xml version="1.0" encoding="UTF-8"?>, you can specify it here. If you do, also use parameter Without XML-Header=true to remove the default XML header.

Replace by new namespace prefix



New namespace prefix to replace with.

Replace orig. namespace prefix

true, false


If true, all original namespace prefixes are replaced.

Text mode (normalize, preserve, trim, trim-full-white)

normalize, preserve, trim, trim-full-white

trim

Configures the way, values are written into the XML file.

preserve - No changes will be made to the text. All whitespaces (leading, trailing, …) will remain in the XML file.

trim-full-white - Same as preserve with the exception that a text, containing only whitespaces, will be replaced by an empty text.

trim - All leading and trailing whitespaces of a text will be removed.

normalize - Same as trim with the addition, that 'inner' whitespaces are reduced to a single space (..1..2.. → 1.2, a dot represents a whitespace).

Use XML short form for empty fields

true, false

false

If true, use XML short form for empty fields (<element/> instead of <element></element>).

Without XML-Header

true, false

false

Create XML file without a header.

Write mandatory empty field

true, false

false

Create elements for all empty mandatory fields.

Write xml in a single line

true, false

false

Write XML in a single line.

file encoding


UTF-8

The name of the character set to be written into the header of the XML file. Note: The encoding in the Response (phase 6) of the profile must be set to the same value to actually save the data with this character set. Otherwise parsing errors on the reading side will most likely occur (mandatory).

template-file



The template file. See section XMLTemplateParserUnit.

with empty fields

true, false

false

Create elements for all empty fields.