I am a newbie with XSL Transformations. I tried all possible options in this site from other questions & answers but i think my situation little unique (atleast for me).
I have to parse below xml and construct a key-value pair kinda structure as an output.
My actual xml is as below.
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/" xmlns:HNS="http://tempuri.org/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://tempuri.org/">
<SOAP-ENV:Header>
<ROClientIDHeader SOAP-ENV:mustUnderstand="0" xmlns="http://tempuri.org/">
<ID>{E931E54B-DA4C-4A93-9BF3-BF82EE028B26}</ID>
</ROClientIDHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body xmlns:ro="http://tempuri.org/">
<v1:Response>
<v1:Result>
<v1:Fields>
<v1:TSimpleDataField>
<v1:FieldName>COMMENT</v1:FieldName>
</v1:TSimpleDataField>
<v1:TSimpleDataField>
<v1:FieldName>SITE_TYPE</v1:FieldName>
</v1:TSimpleDataField>
<v1:TSimpleDataField>
<v1:FieldName>TOTAL_ADDRESSES</v1:FieldName>
</v1:TSimpleDataField>
</v1:Fields>
<v1:Data>
<v1:TVarArray>
<v1:anyType>DQT NLB Dev</v1:anyType>
<v1:anyType>62</v1:anyType>
<v1:anyType>100</v1:anyType>
</v1:TVarArray>
</v1:Data>
</v1:Result>
</v1:Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I want to parse and extract the values under <v1:Fields> and <v1:Data> and construct a single record.
For example, if we take a single key-pair value from these two elements as below
<v1:TSimpleDataField>
<v1:FieldName>COMMENT</v1:FieldName>
</v1:TSimpleDataField>
And
<v1:TVarArray>
<v1:anyType>DQT NLB Dev</v1:anyType>
I want to see the output as below
<v1:Response>
<v1:COMMENT>DQT NLB Dev</v1:COMMENT>
<v1:SITE_TYPE>62</SITE_TYPE>
<v1:TOTAL_ADDRESSES>100</v1:TOTAL_ADDRESSES>
</v1:Response>
what is the best way to write the XSLT to extract this data from this given xml. Any help or pointers would be really appreciated.