Below is the XML Structure.
<Docs>
<Doc>
<Title>Physics</Title>
<Desc>
<Part n="Part 1">
<Chap c="1"/>
<Chap c="2"/>
<Chap c="4"/>
</Part>
</Desc>
</Doc>
<Doc>
<Title>Physics</Title>
<Desc>
<Part n="Part 2">
<Chap c="2"/>
<Chap c="3"/>
<Chap c="4"/>
</Part>
</Desc>
</Doc>
</Docs>
The output, I am after is as follows-
<Title>Physics,#,Part 1 - 1,2,4</Title>
<Title>Physics,#,Part 2 - 2,3,4</Title>
I tried with various combinations using concat
and string-join
but all in vain :(