Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved the exception given in xml output to the trace output #31

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private void xalanTransform() throws IOException {
transformer.getTraceManager().addTraceListener(traceListener);
transformer.transform(xmlSource, result);
} catch (Exception e) {
writer.append(e.toString());
this.traceListener.getSelectedTrace().addTraceContext(String.format("\n%s", e));
} finally {
writer.close();
}
Expand All @@ -93,7 +93,7 @@ private void saxonTransform() throws IOException {
transformer.transform(xmlContext.getSourceObject(), result);

} catch (Exception e) {
writer.append(e.toString());
this.traceListener.getSelectedTrace().addTraceContext(String.format("\n%s", e));
} finally {
writer.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ public interface LadybugTraceListener {
/**Root trace of the tree that that holds all the traces.
* @return returns the root trace*/
Trace getRootTrace();
Trace getSelectedTrace();
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
public class SaxonTraceListener extends StandardDiagnostics implements TraceListener, LadybugTraceListener {
@Getter
private final Trace rootTrace = new Trace();
@Getter
private Trace selectedTrace;
//needed because the order of the methods to end a trace is reversed for some reason by saxon
private boolean end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class XalanTraceListener implements TraceListenerEx2, LadybugTraceListene

@Getter
private final Trace rootTrace = new Trace();
@Getter
private Trace selectedTrace;
/**
* This needs to be set to true if the listener is to print an event whenever a template is invoked.
Expand Down
Loading