/[suikacvs]/www/test/html/entref/unknown-xhtml10-strict.xhtml
Suika

Contents of /www/test/html/entref/unknown-xhtml10-strict.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, 7 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +23 -1 lines
Children listing script added

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24