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...

Matches between a keyword search and resulting occurrences are called ______.

A. hits B. keywords C. tags D. metasearches

Computer Science & Information Technology

JavaScript has no separate declaration for constants, so constants are declared as variables.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology