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 |
|
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
Get step-by-step solutions from verified subject matter experts
