HTML-specific features and guidance
Table of Contents
<summary>Language Info for HTML</summary>
<div class="card">
<ul class="list-group list-group-flush">
<li class="list-group-item">Since PMD 6.45.0</li>
<li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-html/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/html/HtmlLanguageModule.html#"><code>HtmlLanguageModule</code></a></li>
<li class="list-group-item">Id: html</li>
<li class="list-group-item">PMD: ✔️</li>
<li class="list-group-item">CPD: ✔️</li>
</ul>
</div>
The HTML language module uses jsoup for parsing.
XPath rules are supported, but the DOM is not always a typical XML/XPath DOM.
In the Designer, text nodes appear as nodes with name “#text”, but they can
be selected as usual using text()
.
XML Namespaces are not supported. The local name of attributes includes the prefix,
so that you have to select attributes by e.g. //*[@*[local-name() = 'if:true']]
.