Debian Codegraph @

rhino/testsrc/tests/e4x/Expressions/11.1.2.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 = '11.1.2.js';
8
9 START("11.1.2 - Qualified Identifiers");
10
11 x =
12 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
13 soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
14 <soap:Body>
15 <m:getLastTradePrice xmlns:m="http://mycompany.com/stocks">
16 <symbol>DIS</symbol>
17 </m:getLastTradePrice>
18 </soap:Body>
19 </soap:Envelope>;
20
21 soap = new Namespace("http://schemas.xmlsoap.org/soap/envelope/");
22 stock = new Namespace("http://mycompany.com/stocks");
23
24 encodingStyle = x.@soap::encodingStyle;
25 TEST_XML(1, "http://schemas.xmlsoap.org/soap/encoding/", encodingStyle);
26
27 correct =
28 <soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
29 <m:getLastTradePrice xmlns:m="http://mycompany.com/stocks">
30 <symbol>DIS</symbol>
31 </m:getLastTradePrice>
32 </soap:Body>;
33
34 body = x.soap::Body;
35 TEST_XML(2, correct.toXMLString(), body);
36
37 body = x.soap::["Body"];
38 TEST_XML(3, correct.toXMLString(), body);
39
40 q = new QName(soap, "Body");
41 body = x[q];
42 TEST_XML(4, correct.toXMLString(), body);
43
44 correct =
45 <symbol xmlns:m="http://mycompany.com/stocks" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">MYCO</symbol>;
46
47 x.soap::Body.stock::getLastTradePrice.symbol = "MYCO";
48 TEST_XML(5, correct.toXMLString(), x.soap::Body.stock::getLastTradePrice.symbol);
49
50 END();