I have a list of node ids. I want to append "-Selected" to all the text nodes within the given set of node ids. Please let me know how we can achieve the same using XSL?
Input:
<node1 id="a">
<node2 id="b">
<node3 id="c">Text node0</node3>
<node4 id="d">
<node5 id="e">Text node1</node5>
<node6 id="f">Text node2</node6>
</node4>
</node2>
<node7 id="g">Text node3
<node8 id="h" align="center">Text node4</node8>
<node9 id="i">Text node5</node9>
</node7>
<node10 id="j">Text node6
</node10>
<node11 id="h">Text node7
</node11>
</node1>
Input Param: List of node ids
<nodes>
<node>b</node>
<node>g</node>
<node>h</node>
</nodes>
If the input param has node 'a' then i need all the text nodes to be appended with selected.
Expected output:
<node1 id="a">
<node2 id="b">
<node3 id="c">Text node0 - Selected<node3/>
<node4 id="d">
<node5 id="e">Text node1 - Selected</node5>
<node6 id="f">Text node2 - Selected</node6>
</node4>
</node2>
<node7 id="g">Text node3 - Selected
<node8 id="h" align="center">Text node4 - Selected</node8>
<node9 id="i">Text node5 - Selected</node9>
</node7>
<node10 id="j">Text node6
</node10>
<node11 id="h">Text node7 - Selected
</node11>
</node1>