I got this answer to a question i asked yesterday about how to use a path to access an element-
Is it possible to do the opposite? means if i locate a specifiec element(level4 in the xml) with
GetElementsByTagName method is there a way to get the path for this elements and assign it
to a variable for later use?
<?xml version="1.0" encoding="utf-8" ?>
<level1>
<level2>
<level3>header3</level3>
<level4>header4</level4>
<level3>header31</level3>
</level2>
<level2>
<level3>nnn</level3>
<level3>nnnnn</level3>
</level2>
</level1>
Suppose you have extracted your node by
then
and you get “/level1/level2/level4” as the value of sPath