Preface

XQuery is a deep and powerful new language, yet it's easy to pick up and start using productively right away. Accordingly, this book is designed as both an introduction for new XQuery users and a reference for experienced ones.

XQuery is the most complex XML standard to date, comprising well over a thousand pages of very dense and abstract implementation details. If you are creating an XQuery implementation yourself, you need to read them. Everyone else should read this book instead; it will save you a lot of time and confusion. This is the book I wanted when I first got started with XQuery, and am thrilled to have now.

I had the good fortune to become involved with the XQuery standard more than two years ago, before it even had the name. I implemented the first Microsoft XQuery prototype available at MSDN (but not later ones), prototypes of XQuery over SQL Server, and my own XQuery implementation for this book. I've also given several dozen presentations on XQuery, and wrote a chapter about it for a previous book. Currently, I'm responsible for the cross-language XML query representation and optimizer at Microsoft.

However, I've been primarily a user of XQuery rather than an implementer of it. All of this adds up to a unique perspective, which I've brought to bear in this book. I hope my experience with XQuery will benefit you greatly, whether you're using XQuery for the first time or the thousandth.

Who Should Read This Book?

This is a practical book, intended for every developer using XQuery regardless of your programming environment, whether you're a beginner or expert, or whether you're using XML for documents, Web services, databases, or other purposes.

You must be familiar already with the basics of XML 1.0. You need to understand concepts such as namespaces and qualified names, the different XML node kinds (element, attribute, and so on), and the difference between tags and elements. This book doesn't review XML or APIs for using it (like SAX and DOM).

However, you don't need to know XML Schema, XPath, XSLT, SQL, or any of the other technologies that are mentioned throughout this book. You can safely skip sections that compare XQuery to technologies you don't already know.

Organization

This book is organized into four major sections.

Part I introduces XQuery. Chapter 1 briefly touches on the reasons to use XQuery and then gives an overview of the entire language, pointing to later chapters for additional details. Chapters 2 to 4 cover the background material required throughout the rest of the book, starting with the XQuery Data Model and type system. You may want to skim over parts of these chapters and refer back to them later.

Part II drills into the details of XQuery expressions, from arithmetic to XML construction and everything in between.

Part III goes beyond the standards, exploring XQuery expressions whose behavior may surprise you and how to use XQuery to accomplish certain common tasks. Chapter 14 looks at features that might appear in future versions of XQuery.

Finally, Part IV is a comprehensive reference to the entire XQuery language, including appendices on the type system (Appendix A), core expressions (Appendix B), built-in functions (Appendix C), regular expressions (Appendix D), and grammar (Appendix E). These appendices are heavily cross-referenced among one another and the other chapters in the book for your convenience.

Resources

This book isn't tied to any particular implementation of XQuery, and I endeavored to test the examples on several different ones. At http://www.w3.org/XML/Query, the public Web site of the W3C XML Query Working Group, you'll find a list of many freely and commercially available XQuery implementations.

At this book's Web site, http://www.qbrundage.com/xquery, you will find updates and errata to the book as they become available. Additional resources can be found in the Bibliography at the end of this book.

I also encourage you to e-mail your questions and comments to me directly at .

Although I am employed by Microsoft, this book is completely unrelated to Microsoft and its products. Except where noted previously, I played no role in any of Microsoft's XQuery implementations. Or, as the lawyers put it, this book is an independent publication and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by Microsoft Corporation.

Acknowledgments

I owe thanks for this book to a great many people, first and foremost the editors and staff at Addison-Wesley. I always wondered why authors gush about their help, and now I know. To Mary O'Brien, I offer my deepest gratitude, both for asking me at the JavaOne '02 conference to write this book, and also for all her support, encouragement, and advice during its development. Thanks also to Amy Fleischer, Rebecca Greenberg, Chanda Leary-Coutu, Heather Mullane, and Brenda Mulligan for the very hard work they put into making this book a success.

Many technical reviewers, co-workers, friends, and family provided useful feedback on various early drafts. You all helped make this book better than it would have been otherwise! Thanks to Brandon Berg, Mike J. Brown, Michael Champion, Daniel Dedu-Constantin, Damien Fisher, Ken Henderson, Tejal Joshi, Howard Katz, Ashok Malhotra, Eamon O'Tuathail, Dare Obasanjo, Carl Perry, Yvonne Quirmbach-Brundage, Lisa Rein, Ken Sall, and Naohiko Uramoto.

Thanks also to the entire W3C Query Working Group, who answered many questions and accepted at least some of my suggestions. Of these, thanks go especially to Michael Rys (who first introduced me to XQuery!), Don Chamberlain, Ashok Malhotra, and Michael Kay.

Finally, thanks to my wife, Yvonne, for all her patience, encouragement, love, and friendship during this book's development. I couldn't have done it without you!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.2.15