rhino1.7.7.testsrc.tests.e4x.XML.13.4.4.3.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rhino Show documentation
Show all versions of rhino Show documentation
Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically
embedded into Java applications to provide scripting to end users.
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
gTestfile = '13.4.4.3.js';
START("13.4.4.3 - XML appendChild()");
TEST(1, true, XML.prototype.hasOwnProperty("appendChild"));
// Add new employee to list
emps =
Jim 25
Joe 20
;
correct =
Jim 25
Joe 20
Sue 30
;
newEmp = Sue 30 ;
emps.appendChild(newEmp);
TEST(2, correct, emps);
// Add a new child element to the end of Jim's employee element
emps =
Jim 25
Joe 20
;
correct =
Jim 25 snorkeling
Joe 20
;
emps.employee.(name == "Jim").appendChild(snorkeling );
TEST(3, correct, emps);
END();
© 2015 - 2024 Weber Informatics LLC | Privacy Policy