/[suikacvs]/www/test/html/entref/unknown-external-subset.xhtml
Suika

Contents of /www/test/html/entref/unknown-external-subset.xhtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Dec 26 10:45:34 2005 UTC (19 years, 6 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +23 -1 lines
Error occurred while calculating annotation data.
Children listing script added

1 <!DOCTYPE html SYSTEM "unknown-external-subset-dtd.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3 <head>
4 <title>Unknown HTML Character Entity Reference,
5 with Custom External Subset</title>
6 </head>
7 <body>
8 <h1>Unknown 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>unknown</code>
12 general entity.</p>
13
14 <h2>Test</h2>
15
16 <dl id="test-list">
17 <dt><code>&amp;unknown;</code> is rendered as</dt><dd>&unknown;</dd>
18 <dt><code>&amp;#xA9;</code> is rendered as</dt><dd>&#xA9;</dd>
19 </dl>
20
21 <p>The <code>innerHTML</code> of the list above is:</p>
22 <pre id="test-source"></pre>
23 <p>About the first <code>dd</code> element:</p>
24 <ul id="test-nodes">
25 <li>[There is no child.]</li>
26 </ul>
27
28 <script type="text/javascript">
29 var list = document.getElementById ('test-list');
30 document.getElementById ('test-source').appendChild
31 (document.createTextNode (list.innerHTML));
32
33 var listc = list.getElementsByTagName ('dd')[0].childNodes;
34 var ul = document.getElementById ('test-nodes');
35 if (listc.length > 0) {
36 ul.textContent = "";
37 ul.innerText = "";
38 }
39 for (var i = 0; listc.length > i; i++) {
40 var listcn = listc[i];
41 var li = document.createElementNS ("http://www.w3.org/1999/xhtml", 'li');
42 li.appendChild (document.createTextNode
43 (i + "th child is of type |" + listcn.nodeType +
44 "| with name |" + listcn.nodeName + "|, value |" +
45 listcn.nodeValue + "|."));
46 ul.appendChild (li);
47 }
48 </script>
49
50 <h2>Expected Result</h2>
51
52 <dl>
53 <dt><a href="http://www.w3.org/TR/2002/REC-xhtml1-20020801/#uaconf">Conforming XHTML 1.0 User Agent</a></dt>
54 <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>
55 <dd>The character reference (later) is treated as a
56 <code>COPYRIGHT SIGN</code>.</dd>
57 <dd>A user agent that reads external entities will treat
58 the entity reference (former) as a <code>COPYRIGHT SIGN</code>.</dd>
59 <dd>A user agent that does not read the external entity in which
60 the entity declaration for the general entity <code>unknown</code>
61 will render it as a sequence of nine characters:
62 <code>&amp;unknown;</code>.</dd>
63 </dl>
64
65 <h2>Discussion</h2>
66
67 <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>
68
69 </body>
70 </html>

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24