/[suikacvs]/www/test/html/entref/copy-internal-subset.xhtml
Suika

Contents of /www/test/html/entref/copy-internal-subset.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: +28 -1 lines
Children listing script added

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24