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

Re: Re: ANN: A static code quality tool, for XSLT code

Subject: Re: Re: ANN: A static code quality tool, for XSLT code
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Tue, 30 Dec 2008 11:07:46 +0530
Re:  Re: ANN: A static code quality tool
Hi Alain,
   Thanks for suggesting this rule. I feel it's a useful rule.

I have added this rule to the utility I posted, and have made changes
to the site.

You could test it, and let me know if it works fine ...

On Tue, Dec 30, 2008 at 12:41 AM, Alain <alainb06@xxxxxxx> wrote:
> Hello Mukul,
>
> congratulations, it's very nice and useful !
>
> I don't know if it's considered "good practice" or not, but a trap I have
> often gone into is this one.
>
>
> <xsl:variable name="pass1">
> <!--
>     Some code for "Pass 1"
>  -->
> </xsl:variable>
>
> <xsl:apply-templates match="pass1/foo"/>
>
>
> The example is so simple here, it's quite obvious that what I meant was
> probably
>
> $pass1/foo
>
> and not
>
> pass1/foo
>
> But of course the XSLT engine won't complain as the syntax is totally
> correct.
> It will apply templates on any matching pass1/foo child from the current
> location... which generally won't match anything if you just forgot the $
> sign !
> So it's a very difficult typo to catch as everything runs smoothly but does
> not produce the expected result.
>
> And even if you write this code on purpose, it's a very confusion code, and
> I'll find it hard to maintain (I mean naming a variable something and
> matching nodes having the exact same name in the same context), you could
> issue a "Warning" in such a case.
>
> 21. AreYouConfusingVariableAndNode
>
> I suspect the template to trap that is not too complicated in respect to
> what you already did !
>
> Cheers
> Alain.



-- 
Regards,
Mukul Gandhi

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-2007 All Rights Reserved.