Project

Profile

Help

Support #2717

closed

Is there an equivalent of -traceout when running Saxon in Ant?

Added by Mark Dunn about 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2016-04-20
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

I'm trying to use Ant to run a pipeline which includes XSLT transformations, and want to measure their performance.

I'm using the Ant element with an attribute to attach a trace listener:

   <factory name="net.sf.saxon.TransformerFactoryImpl">
    <!-- http://www.saxonica.com/documentation/#!javadoc/net.sf.saxon.lib/FeatureKeys -->
    <attribute name="http://saxon.sf.net/feature/strip-whitespace" value="none"/>
    <attribute name="http://saxon.sf.net/feature/uriResolverClass" value="org.apache.xml.resolver.tools.CatalogResolver"/>
    <attribute name="http://saxon.sf.net/feature/traceListenerClass" value="net.sf.saxon.trace.TimingTraceListener"/>
   </factory> 

Following directions at http://www.saxonica.com/documentation/index.html#!using-xsl/xsltfromant

The profile HTML is written line by line to STDERR:

  [xslt] <html>
  [xslt]    <head>
  [xslt]       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  [xslt]       <title>Analysis of Stylesheet Execution Time</title>
  [xslt]    </head>
  [xslt]    <body>
  [xslt]       <h1>Analysis of Stylesheet Execution Time</h1>
  ...

Is there a way of sending this to its own HTML file?

Equivalent to the -traceout command-line option, or -TP

Actions #1

Updated by Michael Kay about 8 years ago

No, there's no configuration option for this. I would suggest writing a subclass of TimingTraceListener that calls setOutputDestination(new StandardLogger(new File(filename))) in its initialization, and then nominating this subclass as the TraceListener.

Actions #2

Updated by Mark Dunn about 8 years ago

OK, thanks, I'll give it a go.

Actions #3

Updated by O'Neil Delpratt almost 8 years ago

  • Status changed from New to Closed
  • Assignee set to Michael Kay

Please register to edit this issue

Also available in: Atom PDF