<?xml version="1.0"?>
<Student xmlns="http://www.tibco.com/schemas/TrainingPOCs/SharedRec/Schemas/Schema.xsd">
<Phno type="kwh" value="70" name=""/>
<Phno type="wh" value="100" name="80">
<Type>D</Type>
<Mobile>7777777777</Mobile>
<TPhone>6666666666</TPhone>
</Phno>
<Phno type="kwh" value="200" name="">
<Type>E</Type>
<Mobile>5555555555</Mobile>
<TPhone>4444444444</TPhone>
</Phno
</Student>
My input file need to update name attribute with value attribute value wherever type attribute has kWh Scripts i worked on
xmlstarlet edit -N w="http://www.tibco.com/schemas/TrainingPOCs/SharedRec/Schemas/Schema.xsd" -u "/w:Student/w:Phno[@type='kwh']/@name" -x "/w:Student/w:Phno[@type='kwh']/@value" sample.xml