Package org.apache.xalan.xslt.trace

Xalan-Java debugging interface.

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.
 

Package org.apache.xalan.xslt.trace Description

Xalan-Java debugging interface.

 
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();