XML Set Attribute (Legacy Format)

Description

Will add or update an attribute in the XML

Example

Base File


<root>
    <node attr="false">value</node>
</root>

Substitution

New Attribute


<Change>
    <XPath>/root/node</XPath>
    <SetAttribute attributeName="attrVal">true</SetAttribute>
</Change>

Alternative version


<Change>
    <XPath>/root/node</XPath>
    <SetAttribute attributeName="attrVal" value="true" />
</Change>

Existing Attribute


<Change>
    <XPath>/root/node</XPath>
    <SetAttribute attributeName="attr">true</SetAttribute>
</Change>

Alternative version


<Change>
    <XPath>/root/node</XPath>
    <SetAttribute attributeName="attr" value="true" />
</Change>

Output

New Attribute


<root>
    <node attr="false" attrVal="true">value</node>
</root>

Existing Attribute


<root>
    <node attr="true">value</node>
</root>