There are quite a few cases (and they are increasing all the time) where the compiled code in Saxon differs substantially from the original XSLT source. Inevitably this makes it more difficult for operations like tracing and debugging to link the compiled code back to the source code. It also means that any user writing a TraceListener has to be prepared for things to change from one release to the next.
It's true that for many instructions, the InstructionInfo provided to the TraceListener is actually the StyleElement in the source stylesheet. But this is simply because that was a convenient way to implement it, it's not something you should be relying on (it wasn't the case in earlier releases, and it may no longer be the case in future releases). Equally, the set of properties that's available for each instruction isn't fixed.
I'll see if there is some way to provide a "select" property on the LetExpression.
It would help if you explain what you are trying to achieve with your TraceListener.
Michael Kay

From: [] On Behalf Of Marc Pellmann
Sent: 14 February 2005 10:03
Subject: Re: [saxon] no TraceListener event on xsl:variable

It should be fixed. However, XSLT local variables are handled internally as (XQuery-like) "let" expressions, so the event may not reach the trace listener in the form you expect it. See the code in XSLTTraceListener:
Yes - that was the problem. But how could I get the path in the script and the source now!? Cause  the InstructionInfo is not from type StyleElement I could not get the path from it.

And if I try to get the path in the select attribute with instruction.getProperty("select") - I get null. I tryed to get something with this:

info = (NodeInfo)((LetExpression)instruction.getProperty("expression")).evaluateItem(context);
sourcePath = Navigator.getPath(info);

But then the path is not the correct one.
Viele Grüße / best regards

Marc Pellmann
inubit - the integration experts
inubit AG
Lützowstraße 105-106
D-10785 Berlin
Fon: +49.30. 72 61 12-132
Fax: +49.30. 72 61 12-100
Freecall: 0800-go inubit