I'm trying to rename elements with different element names using XSLT. My input XML is lengthy, so making it short below. I'm stuck in this part, can someone provide suggestions on this, provided link below:
<B> <A>
<Year>9</Year>
<Age>40</Age>
<Value>32923.38</Value>
<Value1>135223</Value1>
<Value2>35</Value2>
<Value3>114</Value3>
</A>
<A>
<Year>19</Year>
<Age>30</Age>
<Value>42578.40</Value>
<Value1>123</Value1>
<Value2>70</Value2>
<Value3>115</Value3>
</A>
</B>
Expected output:
<c>
<A>
<day>9</day>
<type>40</type>
<key>32923.38</key>
<level>135223</level>
<pay>35</pay>
<terms>114</terms>
</A>
<A>
<day>19</day>
<type>30</type>
<key>42578.40</key>
<level>123</level>
<pay>70</pay>
<terms>115</terms>
</A>
</c>
XSLT templates I tried:
<xsl:template match="B/A">
<C><xsl:apply-templates select="@*|node()" /></C>
</xsl:template>
Here is the actual XSLT which is doing work of split based on particular element but stuck for above scenario, not knowing how to apply in code and make it work.
I tried multiple ways but none of them working when applied to my code, here is the link of the code below: https://xsltfiddle.liberty-development.net/gVAkJ4Q/4
Updated the original XSLT, since actual source code is very lengthy added link above containing the source code and XSLT.