xslint checks

34 checks available

Check Severity Description
template-match-are-you-confusing-variable-and-node warning A variable name is used bare as a node selector. Use $name syntax to reference the variable.
template-match-blank-nested-if warning A nested xsl:if inside another xsl:if is prohibited. Combine conditions with 'and' into a single xsl:if.
template-match-can-use-abbreviated-axis-specifier warning Verbose axis specifiers child::, attribute::, or parent::node() are used. Replace them with the node name alone, @, or .. respectively.
template-match-empty-content-in-instructions warning An instruction element such as xsl:for-each, xsl:if, or xsl:when has no content. Add content or remove the empty element.
template-match-function-template-complexity warning The function or template contains more than 50 XSLT elements. Split it into smaller, focused units.
template-match-function-template-is-not-child-of-stylesheet error 'xsl:function' or 'xsl:template' are used in the wrong places. Use 'xsl:function' and 'xsl:template' as child nodes of 'xsl:stylesheet'.
template-match-function-use-in-xslt-1 error 'xsl:function' is declared in XSLT version 1.0. Use a named template or upgrade the stylesheet version to 2.0 instead.
template-match-incorrect-use-of-boolean-constants warning Boolean constants 'true' and 'false' are non-empty strings, not booleans. Use true() and false() instead.
template-match-missing-id-in-stylesheet warning The '@id' attribute is missing in the 'xsl:stylesheet' element. Declare it to specify the unique identifier explicitly.
template-match-missing-version-in-stylesheet warning The '@version' attribute is missing in the 'xsl:stylesheet' element. Declare it to specify the stylesheet version explicitly.
template-match-monolithic-design warning The stylesheet contains only one template or function. Extract logic into separate, focused templates.
template-match-name-starts-with-numeric warning A variable, function, or template name starts with a digit, which is invalid in XPath. Rename it to start with a letter.
template-match-not-creating-element-correctly warning xsl:element is used with a static name. Use a literal result element instead.
template-match-not-using-output error The xsl:output instruction is missing. Declare it to specify the serialization format explicitly.
template-match-not-using-schema-types warning No built-in Schema types are used in XSLT 2.0 mode. Declare variable types with xs:string, xs:integer, or similar.
template-match-null-output-from-stylesheet warning The root template contains only variable declarations and produces no output. Add instructions that write to the result tree.
template-match-output-method-xml warning xsl:output declares method='xml' while the root template generates HTML elements. Change the method to 'html'.
template-match-setting-value-of-variable-incorrectly warning A variable is assigned via a nested xsl:value-of instead of the select attribute. Use select syntax instead.
template-match-short-names warning A variable, function, or template has a single-character name. Use a descriptive name that reveals intent.
template-match-starts-with-double-slash warning The match attribute of xsl:template starts with //, which scans the entire document tree. Use a more specific pattern.
template-match-stylesheet-has-no-templates error The stylesheet has no xsl:template elements and produces no output. Add at least one template.
template-match-too-many-small-templates warning The stylesheet has 10 or more templates with fewer than 3 child elements. Merge related small templates to reduce fragmentation.
template-match-unsorted-imports warning The 'xsl:import' elements are not sorted alphabetically by '@href'. Sort imports to improve readability.
template-match-unused-function-template-parameter warning A parameter is declared but never referenced in the function or template body. Remove it or use it.
template-match-unused-function warning A stylesheet function is never called in any match or select expression. Remove it or call it.
template-match-unused-named-template warning A named template is never invoked via xsl:call-template. Remove it or call it.
template-match-unused-variable warning A variable is declared but never referenced by $name in the stylesheet. Remove it or use it.
template-match-use-choose-without-otherwise warning xsl:choose has no xsl:otherwise branch. Add xsl:otherwise to handle unmatched cases explicitly.
template-match-use-double-slash warning The match attribute of xsl:template contains //, which triggers a full document scan. Use a more specific path.
template-match-use-node-set-extension warning The node-set() extension function is unnecessary in XSLT 2.0. Query the variable directly without it.
template-match-use-single-option-for-choose warning xsl:choose contains only one xsl:when branch. Replace it with xsl:if.
template-match-using-disable-output-escaping warning disable-output-escaping='yes' is set, which produces implementation-defined output. Use xsl:copy-of or literal elements instead.
template-match-using-namespace-axis warning The namespace:: axis is deprecated in XSLT 2.0. Use fn:in-scope-prefixes() and fn:namespace-uri-for-prefix() instead.
template-match-using-not-outermost-stylesheet error xsl:stylesheet is nested inside another element. It must be the outermost element of the document.