Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / dom-parse-serialize.html
bloba076483f6ef18737391f8120cc85c97c6b071593
1 <!--
2 - The contents of this file are subject to the Mozilla Public
3 - License Version 1.1 (the "License"); you may not use this file
4 - except in compliance with the License. You may obtain a copy of
5 - the License at http://www.mozilla.org/MPL/
7 - Software distributed under the License is distributed on an "AS
8 - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 - implied. See the License for the specific language governing
10 - rights and limitations under the License.
12 - The Original Code is Mozilla Test Cases.
14 - The Initial Developer of the Original Code is Netscape Communications
15 - Corp. Portions created by Netscape Communications Corp. are
16 - Copyright (C) 2001 Netscape Communications Corp. All
17 - Rights Reserved.
19 - Contributor(s):
20 -->
21 <html>
22 <head>
23 <title>DOMParser/XMLSerializer test</title>
24 <style type="text/css">
25 .box {
26 display: box;
27 border: 1px solid black;
28 margin-bottom: 0.5em;
30 pre {
31 margin-left: 2em;
33 </style>
34 <script type="text/javascript">
36 if (window.testRunner)
37 testRunner.dumpAsText();
39 function execute()
41 var parser = new DOMParser();
42 var str =
43 '<?xml version="1.0"?>\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<f id="&amp;&lt;&gt;>">Four&amp;&lt;&gt;</f><empty/><empty></empty></doc>\n';
44 var doc = parser.parseFromString(str,"text/xml");
46 document.getElementById("id1").firstChild.nodeValue = str;
47 document.getElementById("id2").firstChild.nodeValue = doc;
48 var ser = new XMLSerializer();
49 document.getElementById("id3").firstChild.nodeValue = ser.serializeToString(doc);
52 </script>
53 </head>
54 <body onload="execute();">
55 <h1>DOMParser/XMLSerializer test</h1>
57 <div>The "text to parse" and "document object serialized" boxes should show the same text, and it should be an XML document, not "@@No result@@".
58 </div>
60 <div class="box"><h2>text to parse</h2>
61 <pre id="id1">@@No result@@</pre>
62 </div>
63 <br>
64 <div class="box"><h2>document object</h2>
65 <pre id="id2">@@No result@@</pre>
66 </div>
67 <br>
68 <div class="box"><h2>document object serialized</h2>
69 <pre id="id3">@@No result@@</pre>
70 </div>
72 </body>
73 </html>