Code Inspections in XPath
This topic lists all PhpStorm code inspections available in XPath.
You can toggle specific inspections or change their severity level on the Editor | Inspections page of the IDE settings Ctrl+Alt+S.
Inspection | Description | Default Severity |
---|---|---|
Reports comparisons of the
<xsl:if test="name() = 'xlink:href'">...<xsl:if>
Powered by XPathView + XSLT-Support | Warning | |
Reports implicit conversions between the predefined XPath-types
<xsl:if test="foo" />
is not the same as
<xsl:if test="string(foo)" />
The first test checks whether the element "foo" exists (count(foo) > 0) ; the latter one however is only true if the element actually contains any text (string-length(foo) > 0 ). Suggests making the type conversion more explicit. Use the following options to configure the inspection:
| Warning | |
Reports unnecessary type conversions. Type conversions are unnecessary when the argument type of a | Warning | |
Reports names of elements or attributes that are used in an XPath-expression but are missing in the associated XML files and are not defined in the referenced schemas. Such names are often the result of typos and would otherwise probably only be discovered at runtime. Example:
<xsl:template match="h:txtarea" />
If the h is bound to the XHTML namespace, the inspection will report this part of the match expression as an unknown element name because the correct name of the element is "textarea". Powered by XPathView + XSLT-Support | Warning | |
Reports usages of
//someelement[position() = 0] or //something[0] Powered by XPathView + XSLT-Support | Warning |