1. A method for performing focus inference when compiling an Extensible Markup Language Transforms (XSLT) stylesheet into a compiled XSLT processor, comprising: generating an Abstract Syntax Tree (AST) from said XSLT stylesheet; annotating nodes in said AST that are associated with variables and parameters with focus inference flags, said annotating comprising for each of said nodes determining which of a plurality of focus inference flags that define a focus is required to be maintained; building a reverse call graph for a template associated with the XSLT stylesheet; propagating any focus inference flags from a callee template to a caller template; propagating any focus inference flags through the reverse call graph; and using the focus defined by the focus inference flags directly in one or more of a code generator in an XSLT compilation architecture, an interpreter, and/or a JITer, wherein said focus inference flags comprise a â€œcurrentâ€ focus inference flag, a â€œpositionâ€ focus inference flag, and a â€œlastâ€ focus inference flag.
1. A method for performing focus inference when compiling an Extensible Markup Language Transforms (XSLT) stylesheet into a compiled XSLT processor, comprising: generating an Abstract Syntax Tree (AST) from said XSLT stylesheet; annotating nodes in said AST that are associated with variables and parameters with focus inference flags, said annotating comprising for each of said nodes determining which of a plurality of focus inference flags that define a focus is required to be maintained; building a reverse call graph for a template associated with the XSLT stylesheet; propagating any focus inference flags from a callee template to a caller template; propagating any focus inference flags through the reverse call graph; and using the focus defined by the focus inference flags directly in one or more of a code generator in an XSLT compilation architecture, an interpreter, and/or a JITer, wherein said focus inference flags comprise a â€œcurrentâ€ focus inference flag, a â€œpositionâ€ focus inference flag, and a â€œlastâ€ focus inference flag. 6. The method of claim 1 , further comprising determining one or more parts of a focus that are required for an XPath expression at execution time.