Introduction


XML today needs no introduction: as soon as it hit the streets in 1998 it immediately gained universal acceptance both as a practical tool for use by programmers, and as a strategic technology advocated by captains of industry. XSLT and XPath followed soon afterwards in 1999, and quickly became established as the preferred high-level languages for manipulating XML content, despite a reputation among some users for being difficult to learn (probably a fair comment) and sluggish in performance (less fair, certainly today).

The first edition of this book was published in the Spring of 2000, at the same time as the first complete XSLT implementations were appearing from companies such as Oracle, Microsoft, and IBM. The book quickly became recognized as the definitive reference on the XSLT and XPath languages, only second to the formal specifications from the World Wide Web Consortium (W3C). On the strength of the book, as well as my open -source XSLT implementation Saxon, I was invited to join the W3C Working Group developing the next version of the language, and I later became the editor of the XSLT 2.0 specification. So it's natural that I should now be rewriting the book to cover the new version.

XSLT 2.0 and XPath 2.0 have been a long time in the making. As so often happens with version two of anything, the requirements turned out to be very ambitious. Also, standards work tends to slow down as more people get involved, and with any technology as successful as XML, more people are going to get involved as things move forward. Chapter 1 explains how XPath 2.0 and many of the core ideas influencing the design of XSLT 2.0 were developed collaboratively between two separate Working Groups, whose members came from very different traditions in the IT community. One result is that the specifications are much more bulky than the original 1.0 version (the two languages, XSLT and XPath, are perhaps double the size of the originals , but the specifications are ten times the length). All the more need, therefore, for a book that collects the information together and presents it comprehensively and comprehensibly to the prospective users of the two languages.

The fact that the languages are bigger means that there are more features to learn about: new XSLT instructions for doing grouping and regular expression handling, new data types, a large number of new XPath functions. Paradoxically, however, I think it will now be easier for new users to become proficient in the language, because there is less need to discover the esoteric workarounds for straightforward problems that were the stuff of XSLT 1.0 programming.

In previous editions, XSLT and XPath were covered in a single volume. This time, they have been divided into two separate books: this one covers XSLT 2.0, while the companion book XPath 2.0 Programmer's Reference describes XPath. One reason for the split was that there is simply too much material to cover in detail in a single volume; the other reason is that XPath (as was always intended) has acquired a life of its own separate from XSLT, and there may well be readers who are interested in XPath, without wanting to use XSLT. For XSLT users, however, I would strongly recommend acquiring both volumes .

At the time of writing, the ink is not yet dry on the XSLT 2.0 and XPath 2.0 specifications. Both specifications went into their formal public consultation period on November 12, 2003, along with XQuery 1.0, which is a superset of XPath 2.0. This 3-month consultation generated over a thousand comments, which the working groups are still trawling through as I write in May. These range from simple typos that are easily corrected, to offbeat ideas that have no chance of acceptance. In between these extremes are some tricky bugs and usability problems that need to be fixed. Many of these, however, are corner cases where the final decision is unlikely to affect many everyday applications (an example is the detail of how arithmetic overflow should be handled). There will certainly be a few changes to the three languages as a result of the public consultation, and as a result of implementation experience gathered during the Candidate Recommendation phase that still lies ahead, but my prediction is that these will be minor. Some late changes already agreed have made it into this book. Where possible, we will draw attention to any further changes in the errata published at http://www.wrox.com/ .

The big software companies have not rushed to upgrade their XSLT 1.0 implementations to the 2.0 standard; the signs are that they are waiting until they have confidence that the language is stable. At the time of writing, my own Saxon product is the only reasonably complete XSLT 2.0 implementation (there is also an early beta from Oracle). However, several other products are known to be in development. XPath 2.0 implementations have started to appear in products such as XMLSpy and Stylus Studio. Users, of course, have to make their own decisions about when to start moving forward. For many, the new functionality in XSLT 2.0 has proved compelling, and there are already production applications using the language even before the specifications are finalized.

Who this Book is For

This book, as the title implies, is primarily a practical reference book for professional XSLT developers. It assumes no previous knowledge of the language, and many developers have used it as their first introduction to XSLT; however, it is not structured as a tutorial, and there are other books on XSLT that provide a gentler approach for beginners .

The book does assume a basic knowledge of XML, HTML, and the architecture of the Web, and it is written for experienced programmers. There's no assumption that you know any particular language such as Java or Visual Basic, just that you recognize the concepts that all programming languages have in common.

I have tried to make the book suitable both for XSLT 1.0 users upgrading to XSLT 2.0, and for newcomers to XSLT. This is easier to do in a reference book, of course, than in a tutorial. I have also tried to make the book equally suitable whether you work in the Java or .NET world.

As befits a reference book, a key aim is that the coverage should be comprehensive and authoritative . It is designed to give you all the detail, not just an overview of the 20 percent of the language that most people use 80 percent of the time. It's designed so that you will keep coming back to the book whenever you encounter new and challenging programming tasks , not as a book that you skim quickly and then leave on the shelf. If you like detail, you will enjoy this book; if not, you probably won't.

But as well as giving the detail, this book aims to explain the concepts, in some depth. It's therefore a book for people who not only want to use the language, but who also want to understand it at a deep level. Many readers have written to me saying that they particularly appreciate these insights into the language, and it's my sincere hope that after reading it you will not only be a more productive XSLT programmer, but also a more knowledgeable software engineer.




XSLT 2.0 Programmer's Reference
NetBeansв„ў IDE Field Guide: Developing Desktop, Web, Enterprise, and Mobile Applications (2nd Edition)
ISBN: 764569090
EAN: 2147483647
Year: 2003
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net