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

# Expression tree changes

There have been changes to the internal structure of the expression tree generated by the XSLT, XQuery, and XPath processors, and to the way it is navigated. Most notably, the tree no longer contains any parent pointers linking a subexpression to its containing expression. These have been removed primarily because the code for maintaining the parent pointers was complex and prone to bugs. To compensate for the absence of these pointers, the various traversals of the expression tree (simplify, typeCheck, and optimize), now make use of an `ExpressionVisitor` object that maintains references to all the containing expressions in the form of a stack.

Expressions now have a link to a `Container` object that provides access to the outside world, for example to the `Configuration` and `NamePool`. However, this is used only for diagnostics, because it is not guaranteed to be available in 100% of cases, especially while the tree is under construction.

There is now an internal diagnostic switch allowing tracing of the decisions made by the optimizer. Not all rewrites are yet traced in this way.

The class `IfExpression` no longer exists; all conditional expressions including `xsl:if`, `xsl:choose`, XPath `if-then-else`, and XQuery `typeswitch` are now compiled to a (potentially multi-way) `Choose` expression.