Liquid XML Studio
Xml Target File
See Also Send Feedback
Data Mapping > Data Mapper Functions > By Category > XML > Xml Target File

Glossary Item Box

Function Name
XML Data Target
Category
XML
Icon
XML Target
Description
Define the XML target data for mapping
Inputs
Data items in target Nodes, attributes and values in the target XML data
Outputs
None -
Properties
General Specify the name of the target component
Structure Specify the Schema, root element and type for target structure
Output Specify filename to use as output XML when mapping executes

Usage

Allows JSON documents to created within the Data Mapper.

Creating an XML data target

To begin, drag the XML Target component from the XML section of the Component Palette onto a new Data Mapper file.

XML Data Target Component

This will cause the wizard to launch

You need to provide a schema to describe the data that you will be mapping, you can do this using by providing an XSD, DTD or XDR.

If you don't have a schema (i.e. you just have an xml data file) then you can infer a schema from the XML data file (see Inferring an XML Schema (XSD)).

If you infer an XSD from an XML document, then you may have to finesse the XSD manually in the XSD Editor.

 

 

The second page contains options relating to the inferring process.

Schema Name

The name of the schema that will be produced (there is no need to add the .xsd extension).
If more than 1 schema file needs to be created, then the schema files will be named <Schema Name>1.xsd, <Schema Name>2.xsd etc 

Output Directory

The location where your schema file/files will be written.

Encoding

The encoding that will be applied to your XML Schema (UTF-8 or UTF-16 are the most commonly used, only change this if you understand encoding).

Occurrence Options

If the Occurrence property is set to Restricted, the first time elements are encountered in the XML document, the schema declaration is inferred as minOccurs="1".
When attributes are encountered, the schema declaration is inferred as use="required". If the Occurrence property is set to Relaxed, element schema declarations are inferred as minOccurs="0", and attribute schema declarations are inferred as use="optional".

Type Inference Option

If the TypeInference property is set to Relaxed, the inferred type of elements and attributes in the XML document with simple content is always xs:string.
If the TypeInference property is set to Restricted, more specific types are inferred, such as xs:date, xs:decimal, xs:unsignedByte, and so on.

When you have selected a Schema, the next part of the Wizard will allow you to select the root element or complex type.

Types that are abstract are disabled and grayed out.

Allows you to select the output location for the XML data that this components represents.

No default XML Data

No output filename has been provided so one must be provided within the transform using the 'Filename' input, the resulting XML data will be written to the filename taken from the value of this input.

Write XML data to this file

XML Data is written to the filename provided (the filename can be an absolute path or can be a relative path which will be evaluated relative to the transform file)

Properties

You can alter the Properties of an XML Writer in the Mapper by right-clicking it and choosing Show Properties. These properties can all be set in the Wizard when you add a Target Data component to the Mapper, but if you need to alter any of them you can do so here.

XML Writer Properties

The General tab allows you to alter the name of the component within your mapping project.

General Properties

The Structure tab allows you to select a Schema, root element and type for your source data, as well as instructing the Mapper to validate the Schema when it loads it.

Structure Properties

The Output tab allows you to select a file to write your mapped data to by default when the Mapper executes. Here you can also specify various aspects of the Mapper output, including tabs, spaces, indentation and encoding.

Output Properties

By right-clicking the input items in your XML Writer, you can control Layout and View properties.

Example

Now your XML Target Data component should appear in the Mapper as the XML Writer.

XML Writer

You can click to expand and collapse items in the XML Writer as it appears in the Mapper.

XML Writer

You can make connections between the XML Reader and XML Writer once you have them both imported, by clicking and dragging between items.

XML Reader to XML Writer

These connections define which data items in the source are mapped to items in the target.

Connection Between Reader and Writer

See Also