I have below a sample XML structure:
<root>
<id>1</id>
<name>abc</name>
<id>2</id>
<name>def</name>
<id>3</id>
<name>ghi</name>
</root>
I am trying to achieve the one single following job:
Retrieve the text value of the last occurrence of an id tag in the structure. (Should output 3 in this case).
Can you please help?
I have tried using sed but could not get it to output 3. :D