~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/extensions/xmlextras/tests/parseserialize.html

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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;
 
9
}
 
10
.boxheader {
 
11
  font-weight: bold;
 
12
  color: maroon;
 
13
}
 
14
pre {
 
15
  margin-left: 2em;
 
16
}
 
17
</style>
 
18
<script type="text/javascript">
 
19
function execute()
 
20
{
 
21
  var parser = new DOMParser();
 
22
  var str = 
 
23
    '<?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</doc>\n';
 
24
  var doc = parser.parseFromString(str,"text/xml");
 
25
  
 
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);
 
30
}
 
31
 
 
32
setTimeout(execute,0);
 
33
</script>
 
34
</head>
 
35
<body>
 
36
<h1>DOMParser/XMLSerializer test</h1>
 
37
 
 
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>
 
47
 
 
48
</body>
 
49
</html>