In the following XML, type the most effective XPath that would get you from the red bit to the blue bit. Make sure your XPath is an unambiguous as possible, so that (for instance) if there were multiple <lg> elements in the <div> you would still retrieve the first <l> from the first <lg>.
NOTE: In XPath, there are millions of ways of doing the same thing, so this exercise cannot possibly predict them all. Try to choose the simplest, shortest path you can imagine. If your answer is marked wrong, but you think it's right, check with your instructors in class.
<div type="poem"> <head>I must go down to the sea again</head> <lg> <l>I must go down to the sea again,</l> <l>to the lonely sea and the sky;</l> <l>I left my shoes and socks there -</l> <l>I <emph>wonder</emph> if they're dry?</l> </lg> </div>
In the following XML, type the most effective (accurate and unambiguous) XPath that would get you from the red bit to the green bit. (Look carefully at what exactly is green.)
<div type="poem"> <head>I must go down to the sea again</head> <lg> <l>I must go down to the sea again,</l> <l>to the lonely sea and the sky;</l> <l>I left my shoes and socks there -</l> <l>I <emph>wonder</emph> if they're dry?</l> </lg> </div>
In the following XML, type the most effective XPath that would get you from the blue bit to the purple bit. (The purple bit is the word "I" in the last line.)
<div type="poem"> <head>I must go down to the sea again</head> <lg> <l>I must go down to the sea again,</l> <l>to the lonely sea and the sky;</l> <l>I left my shoes and socks there -</l> <l>I <emph>wonder</emph> if they're dry?</l> </lg> </div>
In the following XML, type the most effective XPath that would get you from the orange bit ("I left my shoes and socks there") to the blue bit.
<div type="poem"> <head>I must go down to the sea again</head> <lg> <l>I must go down to the sea again,</l> <l>to the lonely sea and the sky;</l> <l>I left my shoes and socks there -</l> <l>I <emph>wonder</emph> if they're dry?</l> </lg> </div>
In the following XML, type the most effective XPath that would get you from the purple bit to the orange bit.
<div type="poem"> <head>I must go down to the sea again</head> <lg> <l>I must go down to the sea again,</l> <l>to the lonely sea and the sky;</l> <l>I left my shoes and socks there -</l> <l>I <emph>wonder</emph> if they're dry?</l> </lg> </div>