From the XML document in Fig. 11.15, answer the following questions.

Fig, 11.15
```
1
23

45

6
7
8 15
9

10
11
12
13
14 4800
15

16
17
18
19
20 7000
21

22
23
24
25
26 402.53
27

28
29
30
31
32 10000
33

34
35
36
37
38 3000
39

40
41
42
43
44 400
45

46
47
48
49
50 150
51

52
53
54
55
56 200000
57

58
59

```
a) What is the XPath expression that selects all transaction elements with attribute
date having values between 06/01/2000 and 07/30/2000, inclusive?
b) What is the XPath expression that selects all transaction elements that have an
amount of U.S. dollars (USD) with a value greater than 200?
c) What is the XPath expression that selects all transaction elements from account
100392?
d) What is the XPath expression that calculates the total value of transactions in account
203921?
e) What is the XPath expression to determine the average amount transferred to account
203921?
f) What is the XPath expression that selects all transactions dated 09/03/2000?
g) What is the XPath expression that selects all amount elements with a currency of
NTD whose transaction date is after 09/01/2000?
h) What is the XPath expression to get all transaction elements from part (a) with account
value 100392?


```
a) /transactions/transaction[ @date >= '06/01/2000' and @date <= '07/30/2000' ]
b) /transactions/transaction[ amount/@currency = 'USD'][amount > 200 ]
c) /transactions/transaction[ from/@account = '100392' ]
d) sum( /transactions/transaction[ from/@account ='203921' ]/amount/text() )
e) /transactions/transaction[ to/@account = '203921']/amount/text() ) div count( /transactions/transaction[ to/
@account = '203921' ] )
f) ( /transactions/transaction[ @date = '09/03/2000' ] )
g) /transactions/transaction[ @date > '09/01/2000' ]/amount[ @currency = 'NTD' ]
h) /transactions/transaction[ @date >= '06/01/2000' and@date <= '07/30/2000' ][ from/@account='100392' or to/@account='
100392' ]
```

Computer Science & Information Technology

You might also like to view...

Which part of the Computer window displays the current location in the folder structure as a series of links separated by arrows?

A) Address bar B) Navigation pane C) Content pane D) Folders list

Computer Science & Information Technology

To display the Eraser pointer, you click the Eraser button in the:

A) Draw Borders group on the Table Tools Design tab. B) Table Tools Design group on the Draw Borders tab. C) Erase Table Tools group on the Draw Borders tab. D) Erase Borders group on the Modify Table Tools tab.

Computer Science & Information Technology

The push operation of the ADT stack can throw a StackException.

What will be an ideal response?

Computer Science & Information Technology

To store a single character efficiently, Java provides the ____ type.

A. String B. int C. char D. byte

Computer Science & Information Technology