By Michael Kay
This publication is essentially a pragmatic reference ebook for pro XSLT builders. It assumes no past wisdom of the language, and plenty of builders have used it as their first creation to XSLT; even though, it isn't established as an educational, and there are different books on XSLT that offer a gentler strategy for novices.
The booklet does imagine a uncomplicated wisdom of XML, HTML, and the structure of the internet, and it's written for knowledgeable programmers. There’s no assumption that you simply understand any specific language reminiscent of Java or visible uncomplicated, simply that you simply realize the thoughts that each one programming languages have in universal.
The booklet is acceptable either for XSLT 1.0 clients upgrading to XSLT 2.0, and for novices to XSLT. The ebook is usually both appropriate no matter if you're employed within the Java or .NET international.
As befits a reference publication, a key goal is that the assurance can be complete and authoritative. it really is designed to offer you all of the information, not only an outline of the 20 percentage of the language that almost all humans use eighty percentage of the time. It’s designed so you will retain coming again to the publication everytime you come across new and tough programming initiatives, no longer as a ebook that you simply skim speedy after which depart at the shelf. if you happen to like element, you'll take pleasure in this e-book; if now not, you most likely won’t.
yet in addition to giving the element, this e-book goals to give an explanation for the ideas, in a few intensity. It’s for this reason a publication for those who not just are looking to use the language yet who additionally are looking to realize it at a deep point.
The ebook goals to inform you every thing you must learn about the XSLT 2.0 language. It offers equivalent weight to the issues which are new in XSLT 2.0 and the issues that have been already found in model 1.0. The ebook is set the language, no longer approximately particular items. even though, there are appendices approximately Saxon (the author’s personal implementation of XSLT 2.0), in regards to the Altova XSLT 2.0 implementation, and in regards to the Java and Microsoft APIs for controlling XSLT changes, so as to without doubt be upgraded to deal with XSLT 2.0 in addition to 1.0. a 3rd XSLT 2.0 processor, Gestalt, was once published presently sooner than the publication went to press, too past due to explain it in any element. however the event of XSLT 1.0 is that there was a really excessive point of interoperability among assorted XSLT processors, and in the event you can use one in every of them, you then can use all of them.
within the earlier variation we break up XSLT 2.0 and XPath 2.0 into separate volumes. the belief was once that a few readers could be attracted to XPath by myself. even though, many obtained the XSLT 2.0 ebook with out its XPath significant other and have been left stressed for this reason; so this time, the fabric is again jointly. The XPath reference info is in self-contained chapters, so it may nonetheless be obtainable in case you use XPath in contexts except XSLT.
The booklet doesn't disguise XSL Formatting items, an incredible topic in its personal correct. Nor does it hide XML Schemas in any element. with the intention to use those vital applied sciences at the side of XSLT, there are different books that do them justice.
This booklet comprises twenty chapters and 8 appendixes (the final of that is a thesaurus) geared up into 4 elements. the subsequent part outlines what you will discover in each one half, bankruptcy, and appendix.
Part I: Foundations: the 1st a part of the publication covers crucial strategies. you might want to learn those sooner than you begin coding. for those who forget about this recommendation, as most folk do, then you definately learn them should you get to that trough of depression if you happen to locate it very unlikely to make the language do whatever however the so much trivial initiatives. XSLT isn't the same as different languages, and to make it be just right for you, you must know the way it was once designed for use.
Chapter 1: XSLT in Context: This bankruptcy explains how XSLT suits into the massive photo: how the language got here into being and the way it sits along different applied sciences. It additionally has a couple of basic coding examples to maintain you alert.
Chapter 2: The XSLT Processing Model: this is often concerning the structure of an XSLT processor: the inputs, the outputs, and the knowledge version. figuring out the knowledge version may be crucial factor that distinguishes an XSLT specialist from an beginner; it might look like details that you simply can’t use instantly, yet it’s wisdom that may cease you creating a lot of silly error.
Chapter three: Stylesheet Structure: XSLT improvement is ready writing stylesheets, and this bankruptcy takes a bird’s eye view of what stylesheets appear like. It explains the major strategies of rule-based programming utilizing templates, and explains tips on how to adopt programming-in-the-large through structuring your software utilizing modules and pipelines.
Chapter four: Stylesheets and Schemas: A key innovation in XSLT 2.0 is that stylesheets can make the most of wisdom concerning the constitution of your enter and output records, supplied within the kind of an XML Schema. This bankruptcy offers a brief evaluate of XML Schema to explain its effect on XSLT improvement. now not every person makes use of schemas, and you'll pass this bankruptcy for those who fall into that classification.
Chapter five: the kind System: XPath 2.0 and XSLT 2.0 supply robust typing as a substitute to the susceptible typing technique of the 1.0 languages. which means you could claim the categories of your variables, features, and parameters, and use this data to get early caution of programming error. This bankruptcy explains the knowledge forms on hand and the mechanisms for growing user-defined forms.
Part II: XSLT and XPath Reference: This part of the ebook comprises reference fabric, prepared within the wish so you might simply locate what you wish for those who desire it. It’s no longer designed for sequential examining, even though you may good are looking to look through the pages to find what’s there.
Chapter 6: XSLT Elements: This monster bankruptcy lists all of the XSLT parts you should use in a stylesheet, in alphabetical order, giving unique ideas for the syntax and semantics of every aspect, recommendation on utilization, and examples. this is often most likely the a part of the publication you'll use most often as you develop into knowledgeable XSLT person. It’s a “no stone unturned” technique, in response to the idea that as a certified developer you must comprehend what occurs whilst the going will get difficult, not only while the wind is on your path.
Chapter 7: XPath Fundamentals: This bankruptcy explains the fundamentals of XPath: the low-level constructs akin to literals, variables, and serve as calls. It additionally explains the context principles, which describe how the overview of XPath expressions depends upon the XSLT processing context within which they seem.
Chapter eight: XPath: Operators on Items: XPath bargains the standard variety of operators for appearing mathematics, boolean comparability, and so on. in spite of the fact that, those don’t consistently behave precisely as you will count on, so it’s worthy interpreting this bankruptcy to determine what’s on hand and the way it differs from the final language that you simply used.
Chapter nine: XPath: course Expressions: course expressions are what make XPath unique; they allow you to navigate round the constitution of an XML rfile. This bankruptcy explains the syntax of course expressions, the thirteen axes that you should use to find the nodes that you simply desire, and linked operators akin to union, intersection, and distinction.
Chapter 10: XPath: series Expressions: in contrast to XPath 1.0, in model 2.0 all values are sequences (singletons are only a distinct case). essentially the most very important operators in XPath 2.0 are those who manage sequences, particularly the
«for» expression, which interprets one series into one other via using a mapping.
Chapter eleven: XPath: sort Expressions: the sort process used to be defined in bankruptcy five; this bankruptcy explains the operations so that you can use to exploit kinds. This contains the
«cast» operation that is used to transform values from one sort to another.A significant a part of this bankruptcy is dedicated to the unique principles for the way those conversions are performed.
Chapter 12: XSLT Patterns: This bankruptcy returns from XPath to a topic that’s particular to XSLT. styles are used to outline template ideas, the essence of XSLT’s rule-based programming technique. the cause of explaining them now could be that the syntax and semantics of styles relies strongly at the corresponding principles for XPath expressions.
Chapter thirteen: The functionality Library: XPath 2.0 encompasses a library of services that may be known as from any XPath expression; XSLT 2.0 extends this with a few extra services which are to be had merely while XPath is used inside XSLT. The library has grown immensely because XPath 1.0. This bankruptcy presents a unmarried alphabetical reference for a majority of these features.
Chapter 14: common Expressions: Processing of textual content is a space the place XSLT 2.0 and XPath 2.0 are even more strong than model 1.0, and this is often mostly by using constructs that take advantage of ordinary expressions. If you’re conversant in regexes from languages equivalent to Perl, this bankruptcy tells you ways XPath standard expressions vary. If you’re new to the topic, it explains it from first ideas.
Chapter 15: Serialization: Serialization in XSLT ability the power to generate a textual XML rfile from the tree constitution that’s manipulated by way of a stylesheet. This isn’t a part of XSLT processing right, so (following W3C’s lead) it’s separated it into its personal bankruptcy. you could keep watch over serialization from the stylesheet utilizing an
declaration, yet many items additionally let you regulate it at once through an API.
Part III: Exploitation: the ultimate element of the e-book is suggestion and counsel on tips to benefit from XSLT to write down actual functions. It’s meant to make you not only a reliable XSLT coder, yet a reliable fashion designer too. the way in which of studying is by way of learning the paintings of others, so the emphasis here's on useful case reviews.
Chapter sixteen: Extensibility: This bankruptcy describes the “hooks” supplied within the XSLT specification to permit proprietors and clients to plug in additional performance. the best way this works will range from one implementation to a different, so we can’t hide all probabilities, yet one vital element that the bankruptcy does hide is the right way to use such extensions and nonetheless maintain your code moveable.
Chapter 17: Stylesheet layout Patterns: This bankruptcy explores a few layout and coding styles for XSLT programming, beginning with the easiest “fill-in-the-blanks” stylesheet, and lengthening to the entire use of recursive programming within the practical programming type, that is had to take on difficulties of any computational complexity. this offers a chance to give an explanation for the considering in the back of practical programming and the swap in frame of mind had to take complete good thing about this type of improvement.
Chapter 18: Case research: XMLSpec: XSLT is frequently used for rendering files, so the place higher to seem for a case examine than the stylesheets utilized by the W3C to render the XML and XSLT requisites, and others within the related relatives, for reveal on the internet? The ensuing stylesheets are common of these you will discover in any publishing association that makes use of XML to strengthen a sequence of records with a appropriate look-and-feel.
Chapter 19: Case research: A kin Tree: showing a genealogy is one other common XSLT program. this instance with semi-structured data—a mix of really complicated info and narrative text—that will be offered in lots of alternative ways for various audiences. It additionally exhibits tips to take on one other regular XSLT challenge, conversion of the information into XML from a legacy text-based layout. because it occurs, this makes use of approximately all of the very important new XSLT 2.0 beneficial properties in a single brief stylesheet. yet one other objective of this bankruptcy is to teach a suite of stylesheets doing diversified jobs as a part of a whole software.
Chapter 20: Case learn: Knight's Tour: discovering a course round a chessboard the place a knight visits each sq. with no ever retracing its steps might seem a pretty esoteric program for XSLT, yet it’s a great way of unveiling how even the main advanced of algorithms are in the features of the language. you'll no longer have to take on this actual challenge, but when you need to build an SVG diagram displaying growth opposed to your venture plan, then the issues won’t be that multiple.
Part IV: Appendices: Appendix A: XPath 2.0 Syntax Summary: Collects the XPath grammar principles and operator precedences into one position for ease of reference.
Appendix B: blunders Codes: a listing of all of the mistakes codes outlined within the XSLT and XPath language standards, with short causes that can assist you comprehend what’s long gone fallacious.
Appendix C: Backward Compatibility: The record of items you want to glance out for while changing purposes from XSLT 1.0.
Appendix D: Microsoft XSLT Processors: even if the 2 Microsoft XSLT processors don’t but help XSLT 2.0, we proposal many readers could locate it worthwhile to have a short precis right here of the most gadgets and strategies utilized in their APIs.
Appendix E: JAXP: the Java API for XML Processing: JAXP is an interface instead of a product. back, it doesn’t have particular aid but for XSLT 2.0, yet Java programmers will usually be utilizing it in XSLT 2.0 tasks, so the booklet contains an outline of the periods and techniques to be had.
Appendix F: Saxon: on the time of writing Saxon (developed by means of the writer of this e-book) presents the main complete implementation of XSLT 2.0 and XPath 2.0, so its interfaces and extensions are coated in a few element.
Appendix G: Altova: Altova, the builders of XML undercover agent, have an XSLT 2.0 processor that may be used both as a part of the improvement surroundings or as a freestanding part. This appendix offers info of its interfaces.
Appendix H: Glossary
Note: CD-ROM/DVD and different supplementary fabrics usually are not integrated as a part of e-book file.