| 1 |
<!DOCTYPE html SYSTEM "copy-external-subset-dtd.dtd"> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 3 |
<head> |
| 4 |
<title>Known HTML Character Entity Reference, |
| 5 |
with Custom External Subset</title> |
| 6 |
</head> |
| 7 |
<body> |
| 8 |
<h1>Known HTML Character Entity Reference, with Custom External Subset</h1> |
| 9 |
|
| 10 |
<p>Note: An external subset entity referenced from this document |
| 11 |
by <code>SYSTEM</code> identifier declares the <code>copy</code> |
| 12 |
general entity.</p> |
| 13 |
|
| 14 |
<h2>Test</h2> |
| 15 |
|
| 16 |
<dl id="test-list"> |
| 17 |
<dt><code>&copy;</code> is rendered as</dt><dd>©</dd> |
| 18 |
<dt><code>&#xA9;</code> is rendered as</dt><dd>©</dd> |
| 19 |
</dl> |
| 20 |
|
| 21 |
<p>The <code>innerHTML</code> of the list above is:</p> |
| 22 |
<pre id="test-source"></pre> |
| 23 |
|
| 24 |
<p>About the first <code>dd</code> element:</p> |
| 25 |
<ul id="test-nodes"> |
| 26 |
<li>[There is no child.]</li> |
| 27 |
</ul> |
| 28 |
|
| 29 |
<script type="text/javascript"> |
| 30 |
var list = document.getElementById ('test-list'); |
| 31 |
document.getElementById ('test-source').appendChild |
| 32 |
(document.createTextNode (list.innerHTML)); |
| 33 |
|
| 34 |
var listc = list.getElementsByTagName ('dd')[0].childNodes; |
| 35 |
var ul = document.getElementById ('test-nodes'); |
| 36 |
if (listc.length > 0) { |
| 37 |
ul.textContent = ""; |
| 38 |
ul.innerText = ""; |
| 39 |
} |
| 40 |
for (var i = 0; listc.length > i; i++) { |
| 41 |
var listcn = listc[i]; |
| 42 |
var li = document.createElementNS ("http://www.w3.org/1999/xhtml", 'li'); |
| 43 |
li.appendChild (document.createTextNode |
| 44 |
(i + "th child is of type |" + listcn.nodeType + |
| 45 |
"| with name |" + listcn.nodeName + "|, value |" + |
| 46 |
listcn.nodeValue + "|.")); |
| 47 |
ul.appendChild (li); |
| 48 |
} |
| 49 |
</script> |
| 50 |
|
| 51 |
<h2>Expected Result</h2> |
| 52 |
|
| 53 |
<dl> |
| 54 |
<dt><a href="http://www.w3.org/TR/2002/REC-xhtml1-20020801/#uaconf">Conforming XHTML 1.0 User Agent</a></dt> |
| 55 |
<dd>Both references are treated as <code>COPYRIGHT SIGN</code>s.</dd> |
| 56 |
<dt><a href="http://www.w3.org/TR/2001/REC-xhtml-modularization-20010410/conformance.html#s_conform_user_agent">Conforming XHTML Family User Agent</a></dt> |
| 57 |
<dd>The character reference (later) is treated as a |
| 58 |
<code>COPYRIGHT SIGN</code>.</dd> |
| 59 |
<dd>A user agent that reads external entities will treat |
| 60 |
the entity reference (former) as a <code>COPYRIGHT SIGN</code>.</dd> |
| 61 |
<dd>A user agent that does not read the external entity in which |
| 62 |
the entity declaration for the general entity <code>copy</code> |
| 63 |
will render it as a sequence of six characters: |
| 64 |
<code>&copy;</code>.</dd> |
| 65 |
</dl> |
| 66 |
|
| 67 |
<h2>Discussion</h2> |
| 68 |
|
| 69 |
<p>See a <a href="http://suika.fam.cx/gate/2005/sw/">SuikaWiki</a> article on <a href="http://suika.fam.cx/gate/2005/sw/XHTML/%E5%AE%9F%E4%BD%93%E5%8F%82%E7%85%A7">entity references in XHTML documents</a>.</p> |
| 70 |
|
| 71 |
</body> |
| 72 |
</html> |