Debian Codegraph @

rhino/testsrc/tests/e4x/XML/13.4.4.36.js

raw symbols SCIP
1 /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 gTestfile = '13.4.4.36.js';
8
9 START("13.4.4.36 - setNamespace");
10
11 TEST(1, true, XML.prototype.hasOwnProperty("setNamespace"));
12
13 x =
14 <foo:alpha xmlns:foo="http://foo/" xmlns:bar="http://bar/">
15 <foo:bravo>one</foo:bravo>
16 </foo:alpha>;
17
18 correct =
19 <bar:alpha xmlns:foo="http://foo/" xmlns:bar="http://bar/">
20 <foo:bravo>one</foo:bravo>
21 </bar:alpha>;
22
23 x.setNamespace("http://bar/");
24
25 TEST(2, correct, x);
26
27 var xhtml1NS = new Namespace('http://www.w3.org/1999/xhtml');
28 var xhtml = <html />;
29 xhtml.setNamespace(xhtml1NS);
30
31 TEST(3, 1, xhtml.namespaceDeclarations().length);
32
33 TEST(4, xhtml1NS, xhtml.namespace());
34
35 END();