How to move a child node element value to another child node value using xslt. I need to replace the dummy city with the actual city value from a different child node.
In the below example i need to move the city from Address child node to the Name child node.
Source XML:
<?xml version="1.0" encoding="UTF-8"?>
<M:Top_Node xmlns:M="urn:com">
<M:First_Node>
<M:Employee>
<M:Name>
<M:Employee_ID>001</M:Employee_ID>
<M:Name>sam</M:Name>
<M:City>Dummy_City_CA</M:City>
</M:Name>
<M:Address>
<M:City>Actual_City_CA</M:City>
<M:State>CA</M:State>
</M:Address>
</M:Employee>
<M:Employee>
<M:Name>
<M:Employee_ID>002</M:Employee_ID>
<M:Name>Van</M:Name>
<M:City>Dummy_City_NY</M:City>
</M:Name>
<M:Address>
<M:City>Actual_City_NY</M:City>
<M:State>NY</M:State>
</M:Address>
</M:Employee>
</M:First_Node>
Expected Output:
<?xml version="1.0" encoding="UTF-8"?>
<M:Top_Node xmlns:M="urn:com">
<M:First_Node>
<M:Employee>
<M:Name>
<M:Employee_ID>001</M:Employee_ID>
<M:Name>sam</M:Name>
<M:City>Actual_City_CA</M:City>
</M:Name>
<M:Address>
**<M:City>Actual_City_CA</M:City>**
<M:State>CA</M:State>
</M:Address>
</M:Employee>
<M:Employee>
<M:Name>
<M:Employee_ID>002</M:Employee_ID>
<M:Name>Van</M:Name>
**<M:City>Actual_City_NY</M:City>**
</M:Name>
<M:Address>
<M:City>Actual_City_NY</M:City>
<M:State>NY</M:State>
</M:Address>
</M:Employee>
</M:First_Node>