xslt : how to select an XML element according to the value of a sibling element

PantherR

New Member
Here is my XML :\[code\]<root><parameters><parameter> <key>sEmail</key> <value>[email protected]</value> <type>string</type> <length>255</length></parameter><parameter> <key>sFirstName</key> <value>Bill</value> <type>string</type> <length>40</length></parameter></parameters><root>\[/code\]I want to retrieve the value of the key sEmail and add it as an attribute to the root element using XML to XML xslt.Here is the result expected :\[code\]<root email="[email protected]"><parameters> <parameter> <key>sEmail</key> <value>[email protected]</value> <type>string</type> <length>255</length> </parameter> <parameter> <key>sFirstName</key> <value>Bill</value> <type>string</type> <length>40</length> </parameter></parameters><root>\[/code\]Something similar to this link but with value of element instead of attributes.Can someone help me ? Thanks
 
Back
Top