The current trace interface for interpretive Xalan is sufficient for
tracing through the execution of templates in a stylesheet, the XPath
selection of nodes, and viewing the output as it is created. Currently,
however, when calling extension functions or using extension elements in a
stylesheet, information about which Java functions or BSF scripts are
executed is unavailable.
I propose to implement the following extension to the trace interface. This
extension will allow a trace listener to receive information about
extension functions and elements that are called or executed:
Proposed Implementation
-----------------------
1. While in trace mode, standard Xalan trace listener events (TracerEvent)
will be fired for the template elements associated with extensions:
ElemExtensionCall, ElemExtensionDecl, ElemExtensionScript, ElemFallback.
This is for consistency with the other template elements.
2. Have TraceListenerEx3 extend TraceListenerEx2. This new interface
contains new methods extension() and extensionEnd() through which a
TraceListenerEx3 can receive ExtensionEvents.
3. The ExtensionEvent will contain information about the extension call:
which Java method (or constructor) and arguments should the extension be a
java extension, information about the script if available in a BSF call,
the transformer instance, and the stylesheet template element if
applicable.
4. While in trace mode, immediately prior to an extension call, an
ExtensionEvent will be fired via extension() to the TraceListener.
Immediately after the extension call, the same ExtensionEvent will be fired
via extensionEnd() to the TraceListener. In order to accomplish this, hooks
will be placed in the various subclasses of ExtensionHandler prior to and
after invoking the resolved extension method.
Any comments, questions, or proposed additional requirements are welcome.
Cheers,
Gordon
--
Gordon Chiu
[EMAIL PROTECTED]