Is there a way to split a parent node into multiple nodes using xslt?
I want to transform the source xml into destination.
Source xml
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<item>
<id>Some id</id>
<node1>
<node2 size="10.5" code="abcd"></node2>
<node2 size="10" code="cdef"></node2>
</node1>
</item>
</channel>
</rss>
Destination xml
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<item>
<id>Some id_10.5</id>
<size>10.5</size>
<code>abcd</code>
</item>
<item>
<id>Some id_10</id>
<size>10</size>
<code>cdef</code>
</item>
</channel>
</rss>
If you notice the value of node id in destination xml, it has an underscore and size appended to it.
Very straightforward, it’s not clear why you are finding it difficult.
plus some trivial template rules for other elements.