The question is almost same as one of my question here edit specific xml using xpath
But now the problem is different. The xml structure is little different now. The solution on earlier question will not work here.
I have below xml file
<?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://www.w3.org/2005/xpath-functions">
<map key="Request">
<map key="Headers">
<string key="Accept">application/json</string>
<string key="Content-Type">application/json</string>
</map>
<map key="Payload">
<map key="root">
<array key="req1">
<string>puneet</string>
<string>taneja</string>
</array>
<array key="req2">
<string>ratan</string>
</array>
</map>
</map>
</map>
</map>
Below are the XPATHS
/Request/Headers/Accept=app
/Request/Headers/Content-Type=json
/Request/Payload/root/req1[2]=singh
/Request/Payload/root/req1[1]=pradeep
/Request/Payload/root/req2=suman
I want updated result xml as below
<?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://www.w3.org/2005/xpath-functions">
<map key="Request">
<map key="Headers">
<string key="Accept">application/json</string>
<string key="Content-Type">application/json</string>
</map>
<map key="Payload">
<map key="root">
<array key="req1">
<string>pradeep</string>
<string>singh</string>
</array>
<array key="req2">
<string>suman</string>
</array>
</map>
</map>
</map>
</map>
Basically I want to change my xml on given xpaths using xslt. Check out the code at this location xsltfiddle.liberty-development.net
It will be helpful for me to have update in same earlier solution for this scenario as well.