I am getting an XML in the below format from one of the system. I need to transform the XML.
<parentTag>
<childTag>
<date>28-Jan-2017</date>
<code>DoB</code>
<oldStatus>g</oldStatus>
<newStatus>22</newStatus>
</childTag>
<childTag>
<date>27-Jan-2017</date>
<code>www</code>
<oldStatus>25</oldStatus>
<newStatus>g</newStatus>
</childTag>
<childTag>
<date>26-Jan-2017</date>
<code>DoB</code>
<oldStatus>56</oldStatus>
<newStatus>73</newStatus>
</childTag>
<childTag>
<date>26-Jan-2017</date>
<code>www</code>
<oldStatus>66</oldStatus>
<newStatus>55</newStatus>
</childTag>
</parentTag>
I need to collect all the details for each of the code and transform the XML as below using XSLT 1.0.
<parentTag>
<childTag>
<code>DoB</code>
<status>
<date>28-Jan-2017</date>
<oldStatus>g</oldStatus>
<newStatus>22</newStatus>
</status>
<status>
<date>26-Jan-2017</date>
<oldStatus>56</oldStatus>
<newStatus>73</newStatus>
</status>
</childTag>
<childTag>
<code>www</code>
<status>
<date>27-Jan-2017</date>
<oldStatus>25</oldStatus>
<newStatus>g</newStatus>
</status>
<status>
<date>26-Jan-2017</date>
<oldStatus>66</oldStatus>
<newStatus>55</newStatus>
</status>
</childTag>
</parentTag>
I request you to help on this.
thanks.