Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - XPath Developer's Guide

Determining the Current Context in an XSLT Application

Any XML Path Language (XPath) expression referencing some nodes in a source document is evaluated according to conditions that are true at the time the evaluation occurs. When XPath is being used for a linking application, the context in most cases will not change; each link carries its own context with it. In XSLT applications, however, understanding the context is critical because a number of factors may cause the context to change at various points in the style sheet.

There are two general kinds factors of: static and dynamic.

Static context

The static context includes two general conditions that are true depending on the XPath expression's placement in the XSLT file.

Dynamic context

The dynamic context does not depend on the location of the XPath expression in the XSLT file, but on the state of processing at the time the expression is evaluated. Four factors are included in the dynamic context: the context node, context size, context position, and current node.

See Also

Using XSLT Variables and Parameters | Determining the Context Node | Determining the Context Size | Determining the Context Position | Determining the Current Node