PhpStorm 2022.2 Help

Code Inspection: Hardcoded namespace prefix

Reports comparisons of the name() function with a string that contains a colon (:). Such usages usually indicate a hardcoded namespace prefix in the comparison. As a result, the code will break when run against XML that uses another prefix for the same namespace.

Example:

<xsl:if test="name() = 'xlink:href'">...<xsl:if>

Powered by XPathView + XSLT-Support

Suppress an inspection in the editor

  1. Position the caret at the highlighted line and press Alt+Enter or click the Intention action icon.

  2. Click the arrow next to the inspection you want to suppress and select the necessary suppress action.

Last modified: 13 May 2022