Question: Now consider the following XML document and answer the questions below. 1 2 3 4 5 6 7 8 9 10 Gershwin: Rhapsody In Blue
Now consider the following XML document and answer the questions below.
| 1 2 3 4 5 6 7 8 9 10 |
|

Recall that in an XMLTree the children of a given node are numbered with increasing integer values (indices, positions) starting at 0 for the first child, 1 for the second child, etc. For instance, in the XMLTree above,
What is child 3 of
What is child 0 of
What is child 1 of
A path in an XMLTree can be identified in two different ways by either listing the labels of the nodes on the path or by listing the index of each node (except the root) as a child of its parent. So, for instance, a path from the root to the George Gershwin node can be identified either by listing the nodes on the path: (
Consider the text node An American in Paris in the XML tree above.
Draw the nodes on a path from the root of the tree to this node.
For each of the nodes on this path (except for the root), what is the integer index of the node as a child of its parent?
Adding Attributes
Suppose we modified the XML document above so that both the
| 3 4 | |
Draw the nodes in the XMLTree that would have to be modified to include this new information.
Replacing Attribute with Child
Now suppose we wanted to change the
Rewrite line 5 in the XML document above to show the result of this change.
Draw the nodes in the XMLTree that would have to be modified to reflect this change in the XML document.
Drawing an XMLTree
Consider the following XML document:
| 1 2 3 4 5 6 7 8 |
|
Draw the complete XMLTree corresponding to this document.
A city is logically inside a state. So, change the structure of the XML document to put the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
