Formulate the following XPath queries for the document in Figure 15.21:
a. Find the names of all courses taught by Mary Doe in fall 1995.
b. Find the set of all document nodes that correspond to the course names taught in fall 1996 or all instructors who taught MAT123.
c. Find the set of all course codes taught by John Smyth in spring 1997.
a.
//CrsName[../Instructor="Mary Doe"
and ../@Semester="F1995"]/text()
Note that we use text() at the end to get the text (course names themselves) as opposed to CrsCode element nodes.
b.
//CrsName[../@Semester="F1996"]
| //Instructor[../@CrsCode="MAT123"]
c.
//Class[Instructor="John Smyth" and @Semester="S1997"]/@CrsCode
You might also like to view...
A validation list can be created by all of the following methods EXCEPT:
A) typing the list. B) referring to a range of cells. C) setting validation criteria. D) using a function.
Ann a new small business owner decides to implement WiFi access for her customers. There are several other businesses nearby who also have WiFi hot spots. Ann is concerned about security of the wireless network and wants to ensure that only her customers have access. Which of the following choices BEST meets her intent of security and access?
A. Enable port security B. Enable WPA C. Disable SSID broadcasting D. Enable WEP