I have an Inline XML file(xml tags + text). I want to grab 4 words before a specific tag. For eg:
Case 1:
I used to live in <Location>London</Location>.
Case 2:
I work for <Organization> Microsoft Tech.</Organization>
which is in <Location>London</Location>
I want to grab 4 words before the location tag in both the cases.
OUTPUT:
Case 1:
used to live in
Case 2:
</Organizattion> which is in
Is this possible ?? Can anyone please help me ?