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.
| |||||||
Prerequisites: | [None] | |||||||
Support and limitations: | Works in Ultra Tasks. | |||||||
Account: | Accounts are not used with this Snap. | |||||||
Views: |
| |||||||
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:
| |||||||
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2026 SnapLogic, Inc.