Don't get lost: Training » Integration Cookbook » XML Writer » Attribute Paths

Attribute Paths

Simple attribute subexpressions may be specified in the XPath statement in the form of:

Node[@AttributeName='AttributeValue']/NodeName

This provides the ability to write out separate nodes of the same name where the differentiation is the attribute name and its value, removing the need for complex transformation involving several transformations to achieve this.

The following screenshot illustrates how two address nodes can be written from a single record:

These are achieved by following XPath statements:

Address[@Type='BillTo']/Address1

And

Address[@Type='ShipTo']/Address1