[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT Lint 0.1
On 14/02/2011 13:32, Andriy Gerasika wrote:
Hello, 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|