I have the following stripped down php code...
foreach ($xpath->query('/html/body//a')} as $queryitem) {
$nodeposition = ???;
$parentposition = ???;
}
...from this is it possible to find the position of each node and the position its parent?
for example:
0..<html>
1....<head>
2......<title>
3......<meta>
4......<meta>
5....<body>
6......<div>
7........<a>
This would produce a kind-of ID for each tag and the ID of the parent tag which it joins to.
So the results would be = 0|,1|0,2|1,3|1,4|1,5|0,6|5,7|6