Don't get lost: Training » Integration Cookbook » XML Writer » XML Writer - Attributes

XML WRITER - ATTRIBUTES

SCENARIO

This describes how one or more attributes can be written to an Xml Document.

SOLUTION

  1. Create the following field in a Map transform (obviously the field could come from your source data).
    In this example a second field called Fld2 is created with a static value of "AttributeValue2".

  1. The following assumes that two or more attributes need to be written to the same node. In a real world example the Field XPath may include multiple nodes e.g. "NodeName/NestedNode/....".
  2. In the Attribute property specify the name that you wish the attribute to be.

  1. Repeat this for the other node(s). Notice the same value is used in the XPath property for both fields; but the Attribute is changed.

  1. When the data is refreshed a single node with two attributes will be created.