| OLD | NEW |
| (Empty) |
| 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/ | |
| 6 - | |
| 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. | |
| 11 - | |
| 12 - The Original Code is Mozilla Test Cases. | |
| 13 - | |
| 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. | |
| 18 - | |
| 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; | |
| 29 } | |
| 30 pre { | |
| 31 margin-left: 2em; | |
| 32 } | |
| 33 </style> | |
| 34 <script type="text/javascript"> | |
| 35 | |
| 36 if (window.testRunner) | |
| 37 testRunner.dumpAsText(); | |
| 38 | |
| 39 function execute() | |
| 40 { | |
| 41 var parser = new DOMParser(); | |
| 42 var str = | |
| 43 '<?xml version="1.0"?>\n<!DOCTYPE doc [\n<!ATTLIST d id ID #IMPLIED>\n]>\n<d
oc>\n <foo xmlns="foobar">One</foo> <x:bar xmlns:x="barfoo">Two</x:bar>\n <d i
d="id3">Three</d>\n<f id="&<>>">Four&<></f><empty/><empty></
empty></doc>\n'; | |
| 44 var doc = parser.parseFromString(str,"text/xml"); | |
| 45 | |
| 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(do
c); | |
| 50 } | |
| 51 | |
| 52 </script> | |
| 53 </head> | |
| 54 <body onload="execute();"> | |
| 55 <h1>DOMParser/XMLSerializer test</h1> | |
| 56 | |
| 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> | |
| 59 | |
| 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> | |
| 71 | |
| 72 </body> | |
| 73 </html> | |
| OLD | NEW |