# saxon:explain

This attribute may be set on any instruction in the stylesheet, including a literal result element. The permitted values are "yes" and "no". If the value is "yes", then at compile time Saxon outputs (to the standard error output) an analysis of all XPath expressions appearing on attributes of that instruction. The analysis includes the static type of the expression, and a representation of the expression tree that results from Saxon's parsing and static optimization phases of processing. The tree is represented by indentation. For example, writing:

    <xsl:value-of select="count(*/@test)" saxon:explain="yes" xmlns:saxon="http://saxon.sf.net/"/>

produces the output:

    Attribute select of element xsl:value-of at line 18:
    Static type: xs:integer
    Optimized expression tree:
                        function count
                          path
                            child::*
                            @550

(Here 550 is the internal code allocated to `test` in the name pool).

Expand | Up Next