|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
TraceListener | **For advanced use only** Interface the XSL processor calls when it matches a source node, selects a set of source nodes, or generates a result node. |
Class Summary | |
GenerateEvent | **For advanced use only** Event generated by the XSL processor after it generates a new node in the result tree. |
PrintTraceListener | **For advanced use only** Implementation of the TraceListener interface that prints each event to standard out as it occurs. |
SelectionEvent | **For advanced use only** Event triggered by selection of a node in the style stree. |
TracerEvent | **For advanced use only** Parent class of events generated for tracing the progress of the XSL processor. |
Xalan-Java debugging interface.
TraceListener
is an interface that debuggers
can implement. The interface can be set on the XSLTProcessor
by calling the addTraceListener function.PrintTraceListener
is an implementation of
the TraceListener interface that is used by the Xalan-Java command-line utility
for the -TT, TG, and -TTC flags. You can examine the utility code (Process
)
for examples of how you might use the trace functionality.TracerEvent
is an event that is passed to the
TraceListener trace function. It is called before a node is 'executed' in the stylesheet.GenerateEvent
is an event that is passed to the TraceListener.generated()
function. It is called after an event creating something in the result tree occurs.SelectionEvent
is an event triggered by the selection of a given
style tree node.import org.apache.xalan.xslt.XSLTProcessor; import org.apache.xalan.xslt.trace.PrintTraceListener; ... // Set up a PrintTraceListener object to print to a file. java.io.FileWriter fw = new java.io.FileWriter("events.log"); java.io.PrintWriter pw = new java.io.PrintWriter(fw); PrintTraceListener ptl = new PrintTraceListener(pw); // Print information as each node is 'executed' in the stylesheet. ptl.m_traceElements = true; // Print information after each result-tree generation event. ptl.m_traceGeneration = true; // Print information after each selection event. ptl.m_traceSelection = true; // Print information whenever a template is invoked. ptl.m_traceTemplates = true; // Register the PrintTraceListener with the XSLTProcessor. XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); processor.addTraceListener(ptl); ... // Perform the transformation -- printing information to // events.log during the process. processor.process(new XSLTInputSource("foo.xml"), new XSLTInputSource("foo.xsl"), new XSLTResultTarget("foo.out")); ... // Close the PrintWriter and FileWriter. pw.close(); fw.close(); |
|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |