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

Contents of /www/test/html/entref/unknown-xhtml11.xhtml

Parent Directory Parent Directory | Revision Log Revision Log


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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24