In XSLT, is there a way to determine where you are in an XML document when processing an element?
Example: Given the following XML Doc Fragment...
&l
Don't think this is built into XPath, you probably need a recursive template, like the one here, which I've based this example on. It will walk every element in an XML document and output the path to that element in a style similar to the one you've described.
/
[
]
There are a few complications; consider this tree:
How do you tell the difference between the two child nodes? So you need some index into your item-sequence, child1 and child[2], for example.