Question: Consider the following XML document (adapted from here): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Consider the following XML document (adapted from here):

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

Belgian Waffles

$5.95

Blueberry Pancakes

$4.95

French Toast

$4.50

Homestyle Breakfast

$6.95

Answer the following questions.

Draw the complete XMLTree corresponding to this document.

Assume you have an XMLTree variable called menu initialized with the value of the XML document above. What is the value returned by each of the following calls?

menu.isTag()

menu.label()

menu.numberOfChildren()

menu.hasAttribute("calories")

menu.child(1)

menu.child(1).isTag()

menu.child(1).label()

menu.child(1).numberOfChildren()

menu.child(1).hasAttribute("calories")

menu.child(1).attributeValue("calories")

menu.child(1).child(0).isTag()

menu.child(1).child(0).child(0).isTag()

menu.child(1).child(0).child(0).label()

Modify the document so that the price is an attribute of the name tag.

Redraw the complete XMLTree corresponding to the new document.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!