SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
| Version 9.1 (2008-07-02)
» | Version 9.0 (2007-11-03)
Notices
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# Diagnostics

The format of the "explain" output which displays a compiled and optimized expression tree has changed. The format is now XML, making the raw output amenable to further processing, for example filtering or graphical display. The `-e` flag on the Query command line is extended to allow `-explain:filename`, so that the output can more easily be captured in a file.

The options `-explain` and `-explain:filename` have been added to the `Transform` command line allowing an expression tree to be generated for an entire stylesheet. The extension attribute `saxon:explain` remains available for more selective reporting.

Because the explain output is now XML, it is amenable to analysis using XQuery or XSLT. The Saxon XQuery test driver now allows the test catalog to contain assertions (in the form of XPath expressions) about the content of the expression tree. This allows tests to be written that check not only that the query produces correct results, but that the expected optimizations are applied.

From the Java level, explain output is available via a new method on the `Expression` class. The old `display()` method is retained (for the time being) for compatibility, but produces output in the new format.

Next