I have many XML files, and i have to search in these files a string (in detail that will be a not-too-complicated regex).
With the results i want to get the xpath of the node in which the string is, i.e.:
pattern = /home|house/
files: file1.xml, file2.xml etc
Results:
"home" in file1.xml, xpath: //root/cars/car[2]
"house" in file2.xml, xpath: //root[1]/elemA[2][@attribute1='first']
How can i achieve this? I can use PHP, python, Javascript, VIM plugin (because i already worked with those)