Focus-dependent attribute sets
Although XSLT attribute-sets are normally constant, or depend only on global variables and parameters, they are allowed to have a dependency on the context item, so that the same attribute set produces different values depending on the context where it is used. Saxon attempts to assess whether an attribute set is dependent on the focus, but it can get this wrong, because it makes the assessment when processing a use-attribute-sets "pseudo-expression" which may happen before the target attribute set has been compiled. As a result a use-attribute-sets expression may be considered context independent when this is not the case, resulting in incorrect optimizations such as loop-lifting, and therefore evaluation in the wrong context giving the wrong results.
The emerged from the creation of the somewhat pathological test case attribute-set-0106.
Please register to edit this issue