Expand Attribute Mapping
- Last UpdatedAug 26, 2024
- 2 minute read
Expand Attributes mapping treats a separator-split string in an attribute as a list with syntax to define the separation character and to identify each element of the list by its index value.
The ExpandAttributes element can have two attributes, name and separator. The default separator is comma. You can have multiple attribute blocks, which permit the Name and Value to be specified. The Name attribute cannot be empty.
For example, suppose an input attribute called Content has the value Material, Steel, you can create a new attribute called Material with a Value of Steel using the following mapping. Note that as the separator is not defined, the default value of comma is assumed.
<ExpandAttributes name = "Content">
<Attribute>
<Name index = "1" />
<Value index = "2" />
</Attribute>
</ExpandAttributes>
If the input Content attribute has the value "Pump1 : 10 : kPa", then a new property can be created with the below mapping.
<ExpandAttributes name = "Content" separator = ":" >
<Attribute>
<Name index = "1" />
<Value index = "2" />
<Units index = "3" />
</Attribute>
</ExpandAttributes>
The values of Name element, Value element and Units element are taken directly from the index positions 1-3 of the split list, to create a property with Name as Pump and Value as 10 and Units as kPa in the output EIWM.
New attributes can also be created using the defined value. Consider the following Expand Attribute mapping:
<ExpandAttributes name = "Content" separator = ":">
<Attribute>
<Name value = "Pump" />
<Value value = "Sequence" />
</Attribute>
</ExpandAttributes>
This mapping entry adds a new attribute whose Name will be Pump and Value will be Sequence.
Either value or index attribute can be used with Name, Value and Units elements, but not both for the same element.