Skip to content

format xml

Nathan Richardson edited this page Jan 11, 2019 · 8 revisions
Format XML

Icon

metl xml formatter 48x48 color

Use When

Model based data needs to be formatted into xml text

Samples

Relational Database to Flat File, DB request to WSDL to DB results

Description

The format xml component takes a model based message and formats its content into an xml text message

Inbound Message Type

Model Based Message

Output Message Type

Text Based Message

Control Message Handling

Input: All non-control messages will be added to a list to be processed as they are received. When a control message is received and 'Run When' is 'PER UNIT OF WORK' or when any message other than a control is received and 'Run When' is not 'PER UNIT OF WORK' then the current list of messages collected will be processed and forwarded.

Output: A single control message will be forwarded to downstream components once all messages have been processed through this step.

Properties
Name Description

Input Model

Error Suspense Step

Whether to forward failed messages and continue processing. This is the name of a linked component to forward the failed messages to.

Enabled

Run When

Ignore namespaces for XPath matching

Whether to ignore the namespace when matching the XPath

XML Format

The format of the XML; Pretty, Compact or Raw

XML Null Handling

The method to use for handling null values; Empty element, Remove element or XML nil

Log Input

Log Output

Inbound Queue Capacity

Component Editor

Double clicking on the Format XML component in the flow will result in the Format XML editor being displayed as shown below.

format xml editor

The first step in configuring the xml output is to specify the xml template that will be used to define the xml tag structure of the document. The XML template can be imported from an XSD or WSDL source that resides in a file or at a specified URL. Clicking the "Import Template" button opens the import dialog show below.

format xml editor import template

An XML template can also be manually entered by clicking the "Edit Template" button.

Once an XML template is defined XPath is used to map entities/attributes from the model to the xml template. See examples below.

Example 1. Format Person Entity to XML

XML Template

<Persons>
    <Person>
        <Id></Id>
        <FirstName></FirstName>
        <LastName></LastName>
        <Gender></Gender>
    </Person>
</Persons>

XPath Mapping

format xml editor

Clone this wiki locally