Re: During HTML parsing, are *all* named character references replaced by their corresponding glyph?

Šime Vidas <sime.vidas@gmail.com>, 2013-06-23 00:09 +0200:

> From what I understand, named character references, e.g. &amp;, only exist
> in HTML source code, and once the source code is parsed into the DOM, *all*
> named character entities are replaced by their corresponding glyphs. There
> is no exception to this rule.

The <script> and <style> elements are exceptions

> For instance, this source code:
> 
> <span>&amp;</span>
> 
> will produce a DOM element (of type "span") which contains a single Text
> node which then in turn contains the text value "&". So, not the entity
> &amp; but the actual "&" literal character.

True for all other elements but for <script>&amp;</script> and
<style>&amp;</style> the result's a text node containing the string "&amp;"

-- 
Michael[tm] Smith http://people.w3.org/mike

Received on Monday, 24 June 2013 06:05:00 UTC