On 14/02/2011 13:32, Andriy Gerasika wrote:
Hello,
last couple of days I have been working on IMHO an interesting project
-- XSLT Lint.
While this is laudable, a refactoring like this one:
<!-- old -->
<xsl:variable name="varName">
<xsl:value-of select="xpath"/>
</xsl:variable>
<!-- new -->
<xsl:variable name="varName" select"xpath"/>
isn't safe without first doing a lot of semantic analysis. I think the
preconditions for this to be correct are something like:
"all uses of $varName are dependent only its string value"
For example, if the xpath is //a, where a is an element that does not
exist, then boolean($varName) is true before your refactoring, and false
after it. Similary, <xsl:apply-templates select="$varName"/> will give
completely different results before and after.
It looks to me as if your tool is trying to do refactorings based purely
on local textual pattern matching. That might give good results 95% of
the time, but 95% seems inadequate to me.
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>
--~--