eCube The XSLT Profiler.

Command line interface




Setting the classpath

For using the command line interface of catchXSL! you'll only need the catchXSL! and the XSLT classes in your classpath. For profiling with Xalan as processor include the following jar-files in your classpath:

  • catchXSL.jar
  • xalan.jar
  • xml-apis.jar
  • xercesImpl.jar

For profiling with Saxon you need the following files in your classpath:

  • catchXSL.jar
  • saxon.jar

If you want to profile for both processors you simply add both to your classpath.


TOP



Run catchXSL!

The simplest call of catchXSL! is as follows:

java ecube.xslprofiler.CommandLineStarter <source-xml> <source-xsl> <processor>

where

  • <source-xml> is your input source file
  • <source-xsl> is the stylesheet file
  • <processor> is the name of the processor either xalan or saxon

Important! The produced output is HTML, so you are doing well in redirecting the output to a new file as follows:

java ecube.xslprofiler. .... > result.html

You may then open the result file result.html with your preferred internet browser.

You may try out the samples we provide. Change to the directory $PROFILER_HOME and call:

java ecube.xslprofiler.CommandLineStarter samples/foo.xml samples/foo.xsl saxon
         > result.html

Under $PROFILER_HOME you'll find the simple UNIX shell script "profile" (resp. "profile.cmd" for Windows NT) where you can review the classpath settings and again check how catchXSL! is called. Thus, to run the script you may just change the PROFILER_HOME entry and then call it with:

profile samples/foo.xml samples/foo.xsl > result.html

See Troubleshooting if any problems occur when calling catchXSL!.


TOP




Output of catchXSL!

As already mentioned the profiler lists the profiling results to stdout. Thus, you should redirect the profiler output to a file. In case of HTML output you just open this file with your preferred internet browser. It is important to know that you must have the CSS file result.css in the same directory in order to see the profiling results properly. The file result.css is to be found directly under $PROFILER_HOME.

In case you have specified the option -format xml, you'll get the profiling results as XML. Take a look at this file with your preferred XML-editor.


TOP



Command line options

The following options are available:

-param <name>=<value> 
new in V1.2
specify xslt parameters;simply use this options multiple times to specify more parameters
-format <format> 
specifiy the output format,
where <format> is either html, xml or ascii (default is html)
-tw Not just style events are traced but also write events which occur when parts of the resulting xml-file are written
-out <xml-file> When profiling we are not interested in the result of the transformation but if so, use this option to get the result in <xml-file>
-runs <number> To increase the number of transformation runs (default is 1)
-help Prints a usage message for catchXSL!

The following two options determine the representation of the profiling results. With <runlist> you specify the run(s) for which you want that representation.

-template <runlist> Delivers a "template-oriented" view of the transformation. Thus for each template in the stylesheet you'll see the runtime and the number of calls for it.
-tree <runlist> Delivers a "tree-oriented" view of the transformation.

<runlist> has the following syntax:

<runlist>::=<expr>{", "<expr>}*
<expr>::=number | number"-"number | "avg" | "all"

Examples:

1,3,5 The runs 1,3,5 are listed
all,avg All the runs are listed and also the average times
1,3-5,avg Gets the list of runs 1,3,4,5 and also the average list

If none of the three presentation options is set when calling catchXSL! the default setting is "-template avg", thus delivering the average run times of the templates.



TOP