3 <title>DOMParser/XMLSerializer test
</title>
4 <style type=
"text/css">
7 border: 1px solid black
;
18 <script type=
"text/javascript">
21 var parser
= new DOMParser();
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);
36 <h1>DOMParser/XMLSerializer test
</h1>
38 <div class=
"box"><span class=
"boxheader">text to parse
</span>
39 <pre id=
"id1">@@No result@@
</pre>
41 <div class=
"box"><span class=
"boxheader">document object
</span>
42 <pre id=
"id2">@@No result@@
</pre>
44 <div class=
"box"><span class=
"boxheader">document object serialized
</span>
45 <pre id=
"id3">@@No result@@
</pre>