Re: [xsl] XSLT Lint 0.1

Subject: Re: [xsl] XSLT Lint 0.1
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Mon, 14 Feb 2011 16:20:51 +0000
Perhaps is there some API in Saxon that would tell if XPath is likely to produce single-value or sequence?

Yes, Saxon does extensive static type inferencing, and the types of every expression are available by navigating the expression tree at the end of compilation. (It doesn't give you all the information you would wish for, however: for example there is no data flow analysis, and no linkage from a variable binding to all uses of that variable.)


I do not think 100% refactoring tool is possible. For example, if we take Java static analysis tools, they have all the required information, but sometimes they give false positives, even such great tools as FindBugs. Every change FindBugs is suggesting should be carefully reviewed manually in one-by-one mode, not all changes are ok.

But I think FindBugs does some quite deep semantic analysis before making its suggestions.


Michael Kay
Saxonica

Current Thread