PhpStorm 2021.2 Help

Code Inspection: Unknown element or attribute name



Reports the name of an element or an attribute that is used in an XPath-expression but is missing in the associated XML file and is not defined in the referenced schema. This prevents problems caused by typos in XPath-expressions that otherwise occur when running the script and may even happen not to be recognized immediately.

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

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: 16 July 2021