use of org.apache.xml.dtm.DTMIterator in project intellij-community by JetBrains.
the class XalanTraceListener method trace.
@Override
public void trace(TracerEvent ev) {
if (myTracing)
return;
// prevents handling of recursive trace() events
myTracing = true;
try {
// init
if (firstTrace) {
firstTrace = false;
final SerializationHandler handler = myTransformer.getSerializationHandler();
myTransformer.setSerializationHandler(new TracingSerializationHandler(myDebugger, handler));
}
super.trace(ev);
final DTMIterator iterator = myTransformer.getContextNodeList();
final int node = myTransformer.getMatchedNode();
final Debugger.SourceFrame sourceFrame = myDebugger.getSourceFrame();
final boolean withSource;
if (sourceFrame == null || ((MySourceFrame) sourceFrame).getMatchedNode() != node) {
myDebugger.pushSource(new MySourceFrame(sourceFrame, iterator.getDTM(node), node));
withSource = true;
} else {
withSource = false;
}
myDebugger.enter(new XalanStyleFrame(ev, myDebugger.getCurrentFrame(), withSource));
} finally {
myTracing = false;
}
}
Aggregations