Import from 1.9a8 tarball
[mozilla-extra.git] / extensions / xmlextras / tests / parseserializedisplay.html
blobe15924d0c638687dde6cd98fe9ef089f88642738
1 <html>
2 <head>
3 <title>DOMParser/XMLSerializer test</title>
4 <style type="text/css">
5 .box {
6 display: box;
7 border: 1px solid black;
8 margin-bottom: 0.5em;
10 .boxheader {
11 font-weight: bold;
12 color: maroon;
14 pre {
15 margin-left: 2em;
17 </style>
18 <script type="text/javascript">
19 function execute()
21 var parser = new DOMParser();
22 var str =
23 '<?xml version="1.0"?>\n<?xml-stylesheet href="display.css" type="text/css"?>\n<!DOCTYPE doc [\n<!ATTLIST d id ID #IMPLIED>\n]>\n<doc>\n <foo xmlns="foobar">One</foo> <x:bar xmlns:x="barfoo">Two</x:bar>\n <d id="id3">Three</d>\n</doc>\n';
24 var doc = parser.parseFromString(str,"application/xml");
26 document.getElementById("id1").firstChild.nodeValue = str;
27 document.getElementById("id2").firstChild.nodeValue = doc;
28 var ser = new XMLSerializer();
29 document.getElementById("id3").firstChild.nodeValue = ser.serializeToString(doc);
32 setTimeout(execute,0);
33 </script>
34 </head>
35 <body>
36 <h1>DOMParser/XMLSerializer test</h1>
38 <div class="box"><span class="boxheader">text to parse</span>
39 <pre id="id1">@@No result@@</pre>
40 </div>
41 <div class="box"><span class="boxheader">document object</span>
42 <pre id="id2">@@No result@@</pre>
43 </div>
44 <div class="box"><span class="boxheader">document object serialized</span>
45 <pre id="id3">@@No result@@</pre>
46 </div>
48 </body>
49 </html>