Bad practice naming variables
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 49
- Joined: Mon Mar 12, 2007 1:56 am
- Location: Sweden
Bad practice naming variables
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
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Bad practice naming variables
Hi,
It's not an actual setting, but you can edit the default XSLT validation scenario and remove the additional Schematron validation that reports those warnings.
Note that this removes all XSLT Code Quality Assurance checks that have been added in v19.0.
Steps:
1. Options > Preferences, Document Type Association, select XSLT, press Edit (confirm extending).
2. In the Document type editing dialog go to the Validation tab, edit the XSLT scenario.
3. In the Edit scenario dialog remove the second validation unit, the one with the schema ${baseFramework}/sch/xsltCustomRules.sch.
4. OK in all dialogs.
The alternative is to edit the file Oxygen/frameworks/xslt/sch/xsltCustomRules.sch and change/remove the Schematron rules that bother you.
Regards,
Adrian
It's not an actual setting, but you can edit the default XSLT validation scenario and remove the additional Schematron validation that reports those warnings.
Note that this removes all XSLT Code Quality Assurance checks that have been added in v19.0.
Steps:
1. Options > Preferences, Document Type Association, select XSLT, press Edit (confirm extending).
2. In the Document type editing dialog go to the Validation tab, edit the XSLT scenario.
3. In the Edit scenario dialog remove the second validation unit, the one with the schema ${baseFramework}/sch/xsltCustomRules.sch.
4. OK in all dialogs.
The alternative is to edit the file Oxygen/frameworks/xslt/sch/xsltCustomRules.sch and change/remove the Schematron rules that bother you.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service