3.7 Conclusion
In this chapter, we investigated one of the primary features of XQuery, navigation. We delved into the syntax and meaning of path expressions, and how the evaluation context affects (and is affected by) their evaluation.
The chapter discussed the six required XQuery axes (attribute, child, descendant, descendant-or-self, parent, and self) and the six optional ones (ancestor, ancestor-or-self, preceding, preceding-sibling, following, and following-sibling). In addition, it described the name tests, node kind tests, and wildcards that can be used with axes to select nodes by name, kind, and type.
Predicates can be used to filter an expression by other criteria, including position. Also, XQuery provides several navigation functions, including the important doc() function, which loads external XML data.
We also explored how to solve a variety of real-world tasks using path navigation. Because paths are so important to XQuery, many additional examples appear throughout this book, especially in Chapters 10 and 11.