Bad practice naming variables
Posted: Tue May 09, 2017 11:37 am
Hi,
oXygen 19 includes "bad practice naming variables" messages in the document checking options for XSLT. Something like
<xsl:variable name="part" select="@part"/>
will produce a warning: "Bad practice naming variables the same as elements and attributes from XPath expressions: [part]."
Now, this is a rather subjective rule. I can see why it's sometimes a good idea to avoid naming your variables the same as elements or attributes in the XPath, but there are also plenty of situations when it's actually a good idea. I'm currently working on an XSLT with lots of variables using this naming convention for a very good reason, and that's not about to change. It's not an option and not something I particularly want to discuss.
What I would like is a setting that allows me to turn off this kind of subjective coding style warnings. I can see that I can turn off document checking but that's certainly not what I want, I merely want something that allows me to turn off warnings that I think are subjective and, in my context, wrong. If there is a way to do this now, I was unable to find it.
Many thanks,
Ari Nordstrom
oXygen 19 includes "bad practice naming variables" messages in the document checking options for XSLT. Something like
<xsl:variable name="part" select="@part"/>
will produce a warning: "Bad practice naming variables the same as elements and attributes from XPath expressions: [part]."
Now, this is a rather subjective rule. I can see why it's sometimes a good idea to avoid naming your variables the same as elements or attributes in the XPath, but there are also plenty of situations when it's actually a good idea. I'm currently working on an XSLT with lots of variables using this naming convention for a very good reason, and that's not about to change. It's not an option and not something I particularly want to discuss.
What I would like is a setting that allows me to turn off this kind of subjective coding style warnings. I can see that I can turn off document checking but that's certainly not what I want, I merely want something that allows me to turn off warnings that I think are subjective and, in my context, wrong. If there is a way to do this now, I was unable to find it.
Many thanks,
Ari Nordstrom