title: How to get rid of "undefined attribute name" warnings in XHTML5 documents with SVG elements (in Eclipse)?
body: <p>I am authoring XHTML5 web pages (i.e. HTML5 as well-formed and valid XML) which contain SVG elements. I am using Eclipse (newest version 2019-12) with Web Tools Platform (WTP) installed, which generally works fine for me, but in this case throws warnings which obviously don't make any sense.</p>
  
  <p>Side note: I am not asking how to include SVG in HTML; there are enough tutorials about that, and my pages behave as expected in browsers. My question relates solely to <em>Eclipse</em>, why it shows those warnings, and how to educated it to stop this.</p>
  
  <p>Example XHTML5/SVG document:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" lang="de"&gt;
  
  &lt;head&gt;
    &lt;meta charset="UTF-8" /&gt;
    &lt;title&gt;XHTML5 SVG test&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;svg xmlns="http://www.w3.org/2000/svg" class="declaration"&gt;
    &lt;symbol id="help" viewBox="0 0 24 24"&gt;
      &lt;path fill="var(--fill-color)" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"/&gt;
      &lt;circle fill-opacity="0" cursor="pointer" cx="12" cy="12" r="10"/&gt;
    &lt;/symbol&gt;
  &lt;/svg&gt;
  
  &lt;svg class="Icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
    &lt;use xlink:href="#help"/&gt;
  &lt;/svg&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>With this document, Eclipse gives a warning for (i.e. underlines) each occurrence of <code>xmlns</code>; when hovering the mouse over it, it tells me:</p>
  
  <pre><code>Undefined attribute name (xmlns).
  </code></pre>
  
  <p>The same is true for all other occurrences of all attributes in all elements from the <code>&lt;svg&gt;</code> namespace.</p>
  
  <p>Furthermore, in the same way, it gives warnings about all elements of the <code>&lt;svg&gt;</code> namespace themselves, for example:</p>
  
  <pre><code>Unknown tag (symbol).
  </code></pre>
  
  <p>The same is true for all occurrences of all elements from the <code>&lt;svg&gt;</code> namespace.</p>
  
  <p>How do I configure Eclipse to make it correctly recognize the page's type and namespaces and parse and validate the page correctly? I'd like to cure the cause, not the symptoms. That is, I would be grateful for solutions which actually make Eclipse recognize types and namespaces, while considering solutions where I have to suppress warnings by using pragmas or filter strings only as a last resort.</p>