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
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--