Note that there are some explanatory texts on larger screens.

plurals
  1. POProper entity types for XHTML, XML and inside inline JavaScript
    primarykey
    data
    text
    <p>First, the way I understand it, it's more appropriate to use numeric entities in an XHTML document, such as <code>&amp;#034;</code> instead of <code>&amp;quot;</code>, is that right?</p> <p>Second, for my RSS XML feed, which entity type is correct? Named or numeric? I believe it's numeric, but see examples of both in my searches.</p> <p>Third, which of the following is correct for entities inside inline JavaScript?</p> <pre><code>&lt;span onmouseover="tooltip_on( '&lt;strong&gt;Tooltip inside a span&lt;/strong&gt; &lt;br /&gt;Lorem ipsum dolor sit amet.&lt;span&gt;Lorem ipsum &lt;code&gt;dolor sit&lt;/code&gt; amet, consectetur adipisicing elit.&lt;/span&gt;' );" onmouseout="tooltip_off();"&gt;tooltip inside a span&lt;/span&gt; </code></pre> <p>OR... (the tags inside the <code>JS function</code> are converted to named entities):</p> <pre><code>&lt;span onmouseover="tooltip_on( '&amp;lt;strong&amp;gt;Tooltip inside a span&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;Lorem ipsum dolor sit amet. &amp;lt;span&amp;gt;Lorem ipsum &amp;lt;code&amp;gt;dolor sit&amp;lt;/code&amp;gt; amet, consectetur adipisicing elit.&amp;lt;/span&amp;gt;' );" onmouseout="tooltip_off();"&gt;tooltip inside a span&lt;/span&gt; </code></pre> <p><strong>EDIT 1:</strong></p> <p>Great answers below, but maybe I should have worded my question differently.</p> <p>Disregarding the JavaScript question, which would YOU use for YOUR website and RSS feed:</p> <p>(1) All numeric entities, (2) all named entities, (3) a mixture of both: <code>&amp;amp; &amp;quot; &amp;lt; &amp;gt;</code>, with the rest being numeric.</p> <p>I am leaning towards 3 because my site already has <code>&amp;amp; &amp;quot; &amp;lt; &amp;gt; &amp;#039;</code> deeply embedded, plus <code>htmlspecialchars()</code> used in quite a few places.</p> <p><strong>EDIT 2:</strong></p> <p>All good answers below, folks. Had to pick just one, unfortunately.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload