1 /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is Rhino code, released
19 * The Initial Developer of the Original Code is
20 * Netscape Communications Corporation.
21 * Portions created by the Initial Developer are Copyright (C) 1997-2000
22 * the Initial Developer. All Rights Reserved.
29 * Alternatively, the contents of this file may be used under the terms of
30 * either the GNU General Public License Version 2 or later (the "GPL"), or
31 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
32 * in which case the provisions of the GPL or the LGPL are applicable instead
33 * of those above. If you wish to allow use of your version of this file only
34 * under the terms of either the GPL or the LGPL, and not to allow others to
35 * use your version of this file under the terms of the MPL, indicate your
36 * decision by deleting the provisions above and replace them with the notice
37 * and other provisions required by the GPL or the LGPL. If you do not delete
38 * the provisions above, a recipient may use your version of this file under
39 * the terms of any one of the MPL, the GPL or the LGPL.
41 * ***** END LICENSE BLOCK ***** */
44 START("11.3.1 - Delete Operator");
49 <firstname>John</firstname>
50 <lastname>Doe</lastname>
51 <address>123 Foobar Ave.</address>
56 <description>Big Screen Television</description>
57 <price>1299.99</price>
58 <quantity>1</quantity>
61 <description>Big Screen Television</description>
62 <price>1299.99</price>
63 <quantity>1</quantity>
66 <description>DVD Player</description>
68 <quantity>1</quantity>
72 // Delete the customer address
76 <firstname>John</firstname>
77 <lastname>Doe</lastname>
82 <description>Big Screen Television</description>
83 <price>1299.99</price>
84 <quantity>1</quantity>
87 <description>Big Screen Television</description>
88 <price>1299.99</price>
89 <quantity>1</quantity>
92 <description>DVD Player</description>
94 <quantity>1</quantity>
98 delete order.customer.address;
99 TEST_XML(1, "", order.customer.address);
100 TEST(2, correct, order);
105 <firstname>John</firstname>
106 <lastname>Doe</lastname>
107 <address>123 Foobar Ave.</address>
108 <city>Bellevue</city>
112 <description>Big Screen Television</description>
113 <price>1299.99</price>
114 <quantity>1</quantity>
117 <description>Big Screen Television</description>
118 <price>1299.99</price>
119 <quantity>1</quantity>
122 <description>DVD Player</description>
123 <price>399.99</price>
124 <quantity>1</quantity>
128 // delete the custmomer ID
132 <firstname>John</firstname>
133 <lastname>Doe</lastname>
134 <address>123 Foobar Ave.</address>
135 <city>Bellevue</city>
139 <description>Big Screen Television</description>
140 <price>1299.99</price>
141 <quantity>1</quantity>
144 <description>Big Screen Television</description>
145 <price>1299.99</price>
146 <quantity>1</quantity>
149 <description>DVD Player</description>
150 <price>399.99</price>
151 <quantity>1</quantity>
155 delete order.customer.@id;
156 TEST_XML(3, "", order.customer.@id);
157 TEST(4, correct, order);
162 <firstname>John</firstname>
163 <lastname>Doe</lastname>
164 <address>123 Foobar Ave.</address>
165 <city>Bellevue</city>
169 <description>Big Screen Television</description>
170 <price>1299.99</price>
171 <quantity>1</quantity>
174 <description>Big Screen Television</description>
175 <price>1299.99</price>
176 <quantity>1</quantity>
179 <description>DVD Player</description>
180 <price>399.99</price>
181 <quantity>1</quantity>
185 // delete the first item price
189 <firstname>John</firstname>
190 <lastname>Doe</lastname>
191 <address>123 Foobar Ave.</address>
192 <city>Bellevue</city>
196 <description>Big Screen Television</description>
197 <quantity>1</quantity>
200 <description>Big Screen Television</description>
201 <price>1299.99</price>
202 <quantity>1</quantity>
205 <description>DVD Player</description>
206 <price>399.99</price>
207 <quantity>1</quantity>
211 delete order.item.price[0];
212 TEST_XML(5, "", order.item[0].price);
213 TEST(6, <price>1299.99</price>, order.item.price[0]);
214 TEST(7, order, correct);
219 <firstname>John</firstname>
220 <lastname>Doe</lastname>
221 <address>123 Foobar Ave.</address>
222 <city>Bellevue</city>
226 <description>Big Screen Television</description>
227 <price>1299.99</price>
228 <quantity>1</quantity>
231 <description>Big Screen Television</description>
232 <price>1299.99</price>
233 <quantity>1</quantity>
236 <description>DVD Player</description>
237 <price>399.99</price>
238 <quantity>1</quantity>
242 // delete all the items
243 correct =<order id="123456">
245 <firstname>John</firstname>
246 <lastname>Doe</lastname>
247 <address>123 Foobar Ave.</address>
248 <city>Bellevue</city>
254 TEST_XML(8, "", order.item);
255 TEST(9, correct, order);
257 default xml namespace = "http://someuri";
261 TEST_XML(10, "", x.a.b);
263 var ns = new Namespace("");
264 x.a.b = <b xmlns="">foo</b>;
266 TEST(11, "foo", x.a.ns::b.toString());
269 TEST_XML(12, "", x.a.ns::b);