The interfaces are there in Saxon if you want to attempt it, but you'll have to grovel pretty deep. When you use -T (or -TP), Saxon does two things: firstly, at compile time it applies a CodeInjector which inserts extra code into the expression tree. Then at run-time, it supplies a TraceListener, which gets called at selected points by this injected code. You could exploit this to achieve the desired effect by writing a TraceListener which leaves the data you want "in a well known place", and then have an extension function which retrieves it from there.
But a simpler way, I think, would be to run an XSLT transformation on the stylesheet that generates xsl:message instructions at the start of each template rule.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|