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

« back to all changes in this revision

Viewing changes to mozilla/rdf/resources/dom-test-5.xul

  • 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
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil c-basic-offset: 2 -*- -->
 
2
<!--
 
3
 
 
4
This test exercises creation of DOM elements from the XUL document.
 
5
 
 
6
-->
 
7
 
 
8
<?xml-stylesheet type="text/css" href="dom-test-4.css"?>
 
9
 
 
10
<foo:foo xmlns:foo="http://foo.bar.com/xml#" xmlns:html="http://www.w3.org/1999/xhtml"
 
11
         xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
12
 
 
13
<html:script>
 
14
var count = 0;
 
15
 
 
16
function newElement()
 
17
{
 
18
  var elem = document.createElement('foo:bar');
 
19
  var text = document.createTextNode('Node ' + ++count);
 
20
  elem.appendChild(text);
 
21
  document.lastChild.appendChild(elem);
 
22
}
 
23
 
 
24
function deleteElement()
 
25
{
 
26
  if (document.lastChild.lastChild) {
 
27
    document.lastChild.removeChild(document.lastChild.lastChild);
 
28
  }
 
29
}
 
30
 
 
31
</html:script>
 
32
 
 
33
  <html:input name="b1"
 
34
              type="button"
 
35
              value="New"
 
36
              onclick="newElement();"/>
 
37
 
 
38
  <html:input name="n2"
 
39
              type="button"
 
40
              value="Delete"
 
41
              onclick="deleteElement();"/>
 
42
 
 
43
</foo:foo>