I have an xml file in following format
<root>
<entities>
<entity>
<entity_name></entity_name>
<entity_id></entity_id>
</entity>
<entity>
<entity_name></entity_name>
<entity_id></entity_id>
</entity>
<entity>
<entity_name></entity_name>
<entity_id></entity_id>
</entity>
</entities>
I am trying to convert it into following xml format using xslt.
<root>
<entity_name></entity_name>
<entity_id></entity_id>
<entity_name></entity_name>
<entity_id></entity_id>
<entity_name></entity_name>
<entity_id></entity_id>
I am new to XSLT and have been trying to get to the solution since many hours.
Kindly suggest and if I could get a few good references to learn XSLT, I would really appreciate that.
You can achieve this by building upon the standard XSLT Identity Transform
On its own, it will just copy all your elements as-is. So, what you need to do is add extra templates that match you entities and entity elements, but just output their children without actually copying the elements themselves.
Try the following XSLT
When applied to the following XSLT
The following is output