XML Generator

XML Generator

This page is no longer maintained (Aug 08, 2025). For the most current information, see XML Generator.



On this Page

Snap type:

Read



Description:

This Snap generates a new XML document for the next Snap in the pipeline. The Snap will pass-through the input data if an input view is provided. The output of the Snap will provide an XML attribute in the document which provides the serialized XML content as a string.

  • Expected upstream Snaps: A Mapper Snap which maps into the JSON schema provided by the XML Generator Snap. The provided JSON schema is derived from the XSD that can be provided for the XML Generator Snap.

  • Expected downstream Snaps: The Snap will output one document for every input document, hence and document processing Snap can be used downstream. 

  • Expected input: Document that conforms to variables needed for the variable substitutions of the XML template.

  • Expected output: Document which provides the results of the XML template substitution. Every input document (if an input view is provided) will result in a one output document which provides the result of the XML template substitution under the XML attribute of the document.



Prerequisites:

[None]



Support and limitations:

Works in Ultra Tasks.

Account: 

Accounts are not used with this Snap.



Views:

Input

This Snap has at most one document input view.

Output

This Snap has exactly one document output view.

Error

This Snap has at most one document error view and produces zero or more documents in the view.

Settings

Label



Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.

Inbound schema
 

XML schema definition of the incoming data. 

Schema XPath

The path for the schema object in the provided schema file, which must be used for validating the XML data. This is required if the schema object is nested within a wrapper object or within an object further in the schema file. 

See example Validating XML Data Using the Schema XPath for more information on using the Schema XPath field.

XML root element

Root element for the XML generation.



Validate XML

Required. Appears when you specify an XSD schema definition in the Inbound schema field.

Select this checkbox to validate the incoming data against the specified XSD schema definition.

If you enter an Inbound schema, then you must select Validate XML and Match data types properties to derive the output as per the defined schema. 

Default Value: Deselected

Escape special characters

Select this checkbox to escape XML special characters in XML template variable values when you insert the values into the Apache Velocity template. For example, the Snap replaces < with &It;The special characters that the Snap escapes are:

  • >

  • <

  • &

  • '

  • "

XML Generator normalizes all attributes to use double quotes for the delimiters, even if the source content uses single quotes. Therefore, if there are double quotes that appear inside the attributes, then they have to be escaped.

Learn more: HandlingSpecialCharacters.

Default value: Not selected

We recommend that you select this checkbox unless your variable values contain XML Markup or the contents are already escaped.

Default value for substitution

This value will be used for substitution for the leaf elements which are not objects and/or not enclosed in an array. If nothing is specified and Use default value for substitution is selected, an empty string will be used for substitution.

Use default value for substitution

If you select this check box, the value provided for the Default value for substitution is used for substitution if the elements do not exist in the incoming documents. Otherwise, the elements for which the incoming documents do not have any values will be deleted from the XML.

Namespace Context

Namespace context for schema element.


Prefix

Prefix of schema element in the provided schema file.


Namespace URI

Namespace of schema element in the provided schema file.


Edit XML


Required. This property lets you edit the XML contents. The elements to be generated in the output must be specified in the XML template. If your output does not display the required elements, click Edit XML and specify the applicable elements in the Generate Template tab. You can use the Apache Velocity template to pass dynamic values from upstream Snaps.

Elements specified in the schema document in the Inbound schema field do not affect the output.

Snap Execution




Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.