Workshop
The Workshop is designed to help you anticipate possible questions, review what you've learned, and begin learning how to put your knowledge into practice.
Quiz
| 1. |
How do the queries //vehicle[color='red'] and //vehicle[color='red']/color differ? |
| 2. |
How do you indicate that a query entity is an attribute rather than an element? |
| 3. |
How do you embed query results within other XML code? |
Quiz Answers
| 1. |
The first of the two queries returns vehicle elements that contain a color element set to red. The second of the two queries returns the color elements that are children of those same vehicle elements. |
| 2. |
Names that begin with @ are treated as attributes; names with no qualifier are elements. |
| 3. |
Enclose the query results in {}. |
Exercises
| 1. |
Download an implementation of XQuery, such as Saxon, and use it to write some queries against your own XML documents. You can download a free open source version of Saxon from http://www.saxonica.com/. |