For debugging purposes it would be handy to output the full path of the context node from within a template, is there unabbreviated xpath or function to report this ?
Example Template:
<xsl:template match="@first">
<tr>
<td>
<xsl:value-of select="??WHAT TO PUT IN HERE??"/>
</td>
</tr>
</xsl:template>
Example (Abridged) input document:
<people>
<person>
<name first="alan">
...
The output from the template would be something like:
people / person / name / @first
Or something similar.
Here's a stylesheet (of dubious value) that prints the path to every element and attribute in a document:
When applied to this input:
Produces:
This transformation produces an XPath expression for the wanted node:
when applied on the following XML document:
the wanted, correct result is produced: