Again for this exercise, we'll be working with our XML of Georg Forster's voyage narrative. Download the XML file I have linked here: ForsterGeorgComplete.xml. Open the file in oXygen and work with the XPath 3.1 window. Respond to the XPath questions below in a text file, and upload to Canvas for this assignment when you're finished. (Please use an attachment! If you paste your answer into the text box, Canvas may munch your code syntax.) Some of these tasks are thought-provoking, and even difficult. If you get stuck, do the best you can, and if you can’t get a working answer, give the answers you tried and explain where they failed to get the results you wanted. Sometimes doing that will help you figure out what’s wrong, and even when it doesn’t, it will help us identify the difficult moments.
These tasks require the use of path expressions, predicates, and the functions. There may be more than one possible answer. You may find class notes and our introductory guide Follow the XPath! a helpful resource as you proceed. With the Georg Forster file open in oXygen and using the XPath 3.1 browser window in oXygen, construct XPath expressions that will do the following. Be sure to give the FULL XPath expression you used in your answer, and don't just report your results. This way, if the answer is incorrect, we can help explain what went wrong.
Georg Forster often took note of when latitude and longitude coordinates were measured during his trip with Captain Cook. We've spent some time capturing and coding these (with help from regular expressions!), and now we can use XPath to work with our geographic coordinates. We've used <geo select="lat"> for latitude readings, and <geo select="lon"> for longitude readings.
count()
function and return just the result window. Be careful when you use
the count()
function here that you're getting only the count in Book I.
not()
function to ensure you are finding only paragraphs that do NOT have latitudes marked.) What XPath expression reveals these? And
how many of these paragraphs are there? //p[geo]/placeName[1]
(//p[geo]/placeName)[1]