[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT Lint 0.1

Subject: Re: XSLT Lint 0.1
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Mon, 14 Feb 2011 13:48:14 +0000
Re:  XSLT Lint 0.1
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.