1

Extract TAG name and XPATH from XML file via shellscript

view story
linux-howto

http://www.unix.com – Hi, Here is a sample xml file and expected output. I need to extract the element/tag name (not value) and xpath (sample output.txt). But the main problem is I put here one simple xml file where I can clearly see the number of elements, but in real time I have a xml file which have over 500 elements, so is there any option to find the elements automatically and retrive the xpath. sample.XML: <?xml version = '1.0'?> <ROWSET> <ROW num="1"> <EMPNO>7369</EMPNO> <ENAME>SMITH</ENAME> <JOB>CLERK</JOB> <MGR>7902</MGR> < (HowTos)