Custom XML Output Generation using Inbound Schema and Root Element

This example illustrates the corrected behavior of the XML Generator Snap as of Patch transform8760, whereby the Snap does not ignore any custom XML data that is provided through its XML editor.

Scenario 1: When used with upstream Snaps

The sample Pipeline provided here generates XML for an Add operation. The XML output should contain two integer values: intA and intB.

Download this pipeline

Using two XML Generator Snaps: Customized XML and Generated XML, the Pipeline demonstrates the differing output when custom XML is provided vs when the output is generated using upstream data. Both Snaps are provided the same schema info.

In the Customized XML Snap, custom XML data is provided using the Edit XML field in the Snap Settings as follows:

Here, the values of intA and intB are 0 and 1 respectively.

The Generated XML Snap contains the XML that is generated through the Generate Template button in the XML editor:

In this case, the values of intA and intB are dynamically assigned when the Snap executes.

Both Snaps are fed an input document that specifies intA=2, and intB=3.

Old behavior:

The Customized XML Snap had the same output as the Generated XML Snap and ignored the custom XML data in the editor:

Current behavior:

The two Snaps have different outputs. The output of the Customized XML Snap is based on the XML provided by the user:

The output of the Generated XML Snap is based on upstream data:

Scenario 2: When used as a standalone Snap

The sample Pipeline provided below generates XML for an Add operation.

Custom XML is provided using the Edit XML field, as follows:

Old behavior:

Pipeline execution would result in a Premature end of file error:

Current Behavior

Pipeline execution is successful and custom XML output is generated:

To successfully reuse pipelines:
  1. Download and import the pipeline in to the SnapLogic Platform.
  2. Configure Snap accounts, as applicable.
  3. Provide pipeline parameters, as applicable.