4. Below is a tree representation of an XML document. The tree has 10 nodes, whi
ID: 3579761 • Letter: 4
Question
4. Below is a tree representation of an XML document. The tree has 10 nodes, which we have been numbered 1 through 10. Two of these are text nodes: one containing "Some Text" (labeled #5), and the other "More Text" (labeled #10). In addition, some of the nodes have attributes, e.g. #7 is the tag . D a e ida eld" bid "bob" Some Text More Text For of the following XPath expressions, provide the numbers for the nodes which are each located by the expression. If no nodes match, say NULL. (a) /a/b (b) //f (c) //b/. (d) //c//fExplanation / Answer
a) 2, 4 - because expression reached b node and hence b and its child nodes are selected.
b) only 9 - since // means the selection starts from current node
c) 1,2,3,4,5,6,7,8,9,10 - All the nodes come into picture since node starting from b and its parent node are selected.
d) only 9 is selected.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.