Jérôme Bernard has over seven years experience developing J2SE, J2EE and distributed applications applied to a wide range of applications from banking to insurances as well as distributed applications using Jini. He is currently working as a J2EE consultant at StepInfo and for his own company, Kalixia, where he is working on e-commerce and affiliations tools using cutting-edge technologies.
| Author(s) | Priscilla Walmsley |
|---|---|
| Publisher | O'Reilly |
| PubDate | 2007, April. 1st edition |
| Reviewer | Jérôme Bernard |
![]() |
Purchase and help Javalobby |
|
This is the only book I've read on the topic that successfully provides both introduction and reference material.
The first half of the book presents the XQuery language and each of its building blocks. The following chapters are for readers familiar with SQL, XSLT and explains how to relate those standards with XQuery. Finally, the last part of the book is reference material for the XQuery functions, types and errors.
Positives
Negatives
|
The author does not assume any specific knowledge except XML basics.
This book presents the XQuery language and explains every building block of the language with plenty of examples.
After reading this book, you'll be up to speed in order to write XQuery queries.
The only thing left is how to use it with some XML databases or XQuery products.
Chapter 1 - Introduction to XQuery shortly presents in 10 pages the capabilities of XQuery and gives plenty of simple explained examples illustrating various XQuery queries.
Chapters 2 to 5 (respectively XQuery Foundations, Expressions: XQuery Building Blocks, Navigating Input Documents Using Paths and Adding Elements and Attributes to Results) introduce the data model, the basics of XQuery expression, explain how to query by paths and how to navigate in XML documents and finally give information on how to build XML results.
Chapter 6 and 7 (Selecting and Joining Using FLWORs and Sorting and Grouping) explains how to query a XQuery data model and do operations familiar to databases users like joining, grouping and sorting. These chapters are really useful and should be read multiple times especially for SQL developers as some principles differs from the SQL language.
Chapter 8 - Functions explains how XQuery functions are written and Chapter 9 - Advanced Queries gives plenty of example functions, which can be found on the companion web site.
Chapter 10 - Namespaces and XQuery explains how XML uses namespaces and illustrates how to query XML documents using XML namespaces.
Chapter 11 - A Closer Look at Types explains built-in XQuery types and casting rules.
Chapter 12 - Queries, Prologs, and Modules is a follow-up of chapter 8 and 9 explaining how to write XQuery modules (somehow packages of XQuery functions).
Chapter 13 - Using Schemas with XQuery explains how XQuery can benefit from XML schemas attached to XML documents.
Chapter 14 - Static Typing introduces features likes instance of, type declaration and how to generate errors if the cardinality of arguments is not matched.
Chapter 15 - Principles of Query Design is about best practices for XQuery, like modularity, missing values, errors handling and performance issues.
Chapter 16 to 21 (Working with Numbers, Working with Strings, Regular Expressions, Working with Dates, Times, and Durations, Working with Qualified Names, URIs, and IDs and Working with Other XML Components) explains in great detail the specifics of the built-in data types of the XQuery language. These chapters do introduce plenty of useful functions that are not part of the XQuery standard which are generally useful for real-world projects.
Chapter 22 - Additional XQuery-Related Standards explains how to serialize a XQuery data model into a XML string, XQueryX syntax for XQuery queries written as XML documents, the not-yet standardized XQuery Update specification, Full Text Search and finally the yet to be voted XQuery API for Java (XQJ).
Chapter 23 - Implementation-Specific Features is a really short chapter (5 pages!) explaining how to specify options to the XQuery engine.
Chapter 24 - XQuery for SQL Users explains equivalences and differences between those two languages. It also explains how to use XML data contained in SQL databases.
Chapter 25 - XQuery for XSLT Users is quite similar to the previous one, but comparing XQuery to XSLT this time. Some differences are subtle so users familiar with XSLT should pay attention to the content of this chapter!
Appendix A - Built-in Function Reference is reference material on all the built-in functions of the XQuery language. Especially well written with in-depth information and examples illustrating usage of each function.
Appendix B - Built-in Types gives in-depth knowledge of the XQuery data types. It illustrates the format of the various types, how they are casted and compared to other types, and their relationship.
Appendix C - Error Summary is all about errors messages and categories. This chapter shortly explains how to solve some of the errors.
N.B.: the content of the appendices is available on the companion website through a web interface.
Overall, I am really pleased with this book. I've read some other on the same topic and they were either not as compact or not focused enough.
The material available in this book clearly illustrates how the author master the XQuery language and give plenty of information usually needed for real-world projects, through some XQuery functions which should have been added to the language.
I have personally used this book for a real-world project dealing with lots of XML documents and it has proved to be really useful. The companion website is also a must-have when developing XQuery functions.
The only things I would have liked to see in the book are examples with native XML databases (like Oracle Berkeley DB XML) and using Java XQuery engines (such as Saxon).
| Relevance | |
|---|---|
| Readability | |
| Overall | |
The companion website: http://www.xqueryfunctions.com/xq/