By Michael Kay
This e-book is basically a pragmatic reference e-book for pro XSLT builders. It assumes no past wisdom of the language, and lots of builders have used it as their first advent to XSLT; despite the fact that, it isn't established as an instructional, and there are different books on XSLT that supply a gentler process for newbies.
The ebook does suppose a uncomplicated wisdom of XML, HTML, and the structure of the net, and it's written for knowledgeable programmers. There’s no assumption that you just recognize any specific language corresponding to Java or visible easy, simply that you just realize the strategies that each one programming languages have in universal.
The ebook is appropriate either for XSLT 1.0 clients upgrading to XSLT 2.0, and for newbies to XSLT. The e-book is usually both appropriate no matter if you're employed within the Java or .NET international.
As befits a reference publication, a key target is that the insurance may be entire and authoritative. it truly is designed to provide you the entire info, not only an summary of the 20 percentage of the language that almost all humans use eighty percentage of the time. It’s designed so you will continue coming again to the e-book everytime you come upon new and difficult programming initiatives, now not as a booklet that you simply skim quick after which depart at the shelf. if you happen to like aspect, you'll take pleasure in this e-book; if no longer, you possibly won’t.
yet in addition to giving the aspect, this e-book goals to provide an explanation for the ideas, in a few intensity. It’s accordingly a publication for those who not just are looking to use the language yet who additionally are looking to comprehend it at a deep point.
The ebook goals to inform you every little thing you must find out 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 booklet is set the language, no longer approximately particular items. in spite of the fact that, there are appendices approximately Saxon (the author’s personal implementation of XSLT 2.0), concerning the Altova XSLT 2.0 implementation, and in regards to the Java and Microsoft APIs for controlling XSLT adjustments, in order to without doubt be upgraded to address XSLT 2.0 in addition to 1.0. a 3rd XSLT 2.0 processor, Gestalt, used to be published presently sooner than the booklet went to press, too overdue to explain it in any aspect. however the event of XSLT 1.0 is that there was a truly excessive point of interoperability among diverse XSLT processors, and if you happen to can use one among 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 used to be that a few readers should be attracted to XPath by myself. in spite of the fact that, many got the XSLT 2.0 publication with no its XPath significant other and have been left burdened for this reason; so this time, the cloth is again jointly. The XPath reference details is in self-contained chapters, so it's going to nonetheless be available in case you use XPath in contexts except XSLT.
The e-book doesn't conceal XSL Formatting items, a major topic in its personal correct. Nor does it conceal XML Schemas in any element. on the way to use those vital applied sciences together with XSLT, there are different books that do them justice.
This booklet includes twenty chapters and 8 appendixes (the final of that is a thesaurus) prepared into 4 elements. the next part outlines what you'll find in every one half, bankruptcy, and appendix.
Part I: Foundations: the 1st a part of the ebook covers crucial innovations. you'll want to learn those earlier than you begin coding. in case you forget about this recommendation, as most folks do, then you definitely learn them in case you get to that trough of depression for those who 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 want to know the way it used to be designed for use.
Chapter 1: XSLT in Context: This bankruptcy explains how XSLT matches into the large photo: how the language got here into being and the way it sits along different applied sciences. It additionally has a number of easy coding examples to maintain you alert.
Chapter 2: The XSLT Processing Model: this is often in regards to the structure of an XSLT processor: the inputs, the outputs, and the knowledge version. knowing the knowledge version might be an important factor that distinguishes an XSLT specialist from an beginner; it might probably appear like info that you just can’t use instantly, yet it’s wisdom that might cease you creating a lot of silly errors.
Chapter three: Stylesheet Structure: XSLT improvement is set writing stylesheets, and this bankruptcy takes a bird’s eye view of what stylesheets seem like. It explains the most important techniques of rule-based programming utilizing templates, and explains the right way 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 reap the benefits of wisdom concerning the constitution of your enter and output records, supplied within the kind of an XML Schema. This bankruptcy presents a short assessment of XML Schema to explain its impression on XSLT improvement. no longer every body makes use of schemas, and you'll bypass this bankruptcy for those who fall into that classification.
Chapter five: the sort System: XPath 2.0 and XSLT 2.0 supply powerful typing instead to the vulnerable typing technique of the 1.0 languages. which means you could claim the categories of your variables, features, and parameters, and use this knowledge to get early caution of programming blunders. This bankruptcy explains the knowledge kinds to be had and the mechanisms for developing user-defined kinds.
Part II: XSLT and XPath Reference: This portion of the e-book includes reference fabric, equipped within the wish that you should simply locate what you would like for those who want it. It’s now not designed for sequential studying, even though chances are you'll good are looking to glance 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 distinctive principles 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 are going to use most often as you turn into a professional XSLT person. It’s a “no stone unturned” method, in response to the assumption that as a certified developer you want to comprehend what occurs whilst the going will get tricky, not only while the wind is on your path.
Chapter 7: XPath Fundamentals: This bankruptcy explains the fundamentals of XPath: the low-level constructs reminiscent of literals, variables, and serve as calls. It additionally explains the context principles, which describe how the overview of XPath expressions relies on the XSLT processing context during which they seem.
Chapter eight: XPath: Operators on Items: XPath bargains the standard variety of operators for acting mathematics, boolean comparability, and so on. despite the fact that, those don’t continuously behave precisely as you'll anticipate, so it’s worthy analyzing this bankruptcy to determine what’s on hand and the way it differs from the final language that you just used.
Chapter nine: XPath: course Expressions: direction expressions are what make XPath detailed; they permit you to navigate round the constitution of an XML rfile. This bankruptcy explains the syntax of direction expressions, the thirteen axes that you should use to find the nodes that you just desire, and linked operators reminiscent of union, intersection, and distinction.
Chapter 10: XPath: series Expressions: not like XPath 1.0, in model 2.0 all values are sequences (singletons are only a different case). the most vital operators in XPath 2.0 are those who control sequences, particularly the
«for» expression, which interprets one series into one other by way of utilizing a mapping.
Chapter eleven: XPath: sort Expressions: the kind approach was once defined in bankruptcy five; this bankruptcy explains the operations so you might use to exploit kinds. This contains the
«cast» operation that's used to transform values from one kind to another.A large a part of this bankruptcy is dedicated to the precise principles for the way those conversions are performed.
Chapter 12: XSLT Patterns: This bankruptcy returns from XPath to a subject matter 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's 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 features that may be known as from any XPath expression; XSLT 2.0 extends this with a few extra capabilities which are on hand in basic terms whilst XPath is used inside of XSLT. The library has grown immensely due to the fact XPath 1.0. This bankruptcy offers a unmarried alphabetical reference for some of these services.
Chapter 14: normal Expressions: Processing of textual content is a space the place XSLT 2.0 and XPath 2.0 are even more robust than model 1.0, and this can be mostly by utilizing constructs that make the most ordinary expressions. If you’re accustomed to regexes from languages corresponding to Perl, this bankruptcy tells you ways XPath typical expressions fluctuate. If you’re new to the topic, it explains it from first rules.
Chapter 15: Serialization: Serialization in XSLT skill the facility to generate a textual XML record from the tree constitution that’s manipulated by means 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 regulate serialization from the stylesheet utilizing an
declaration, yet many items additionally let you keep watch over it without delay through an API.
Part III: Exploitation: the ultimate element of the ebook is recommendation and assistance on find out how to reap the benefits of XSLT to jot down genuine purposes. It’s meant to make you not only a reliable XSLT coder, yet a reliable fashion designer too. the way of studying is via 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 differ from one implementation to a different, so we can’t hide all chances, yet one very important element that the bankruptcy does conceal is find out how to use such extensions and nonetheless preserve your code moveable.
Chapter 17: Stylesheet layout Patterns: This bankruptcy explores a few layout and coding styles for XSLT programming, beginning with the best “fill-in-the-blanks” stylesheet, and increasing to the entire use of recursive programming within the practical programming kind, that's had to take on difficulties of any computational complexity. this gives a chance to give an explanation for the considering in the back of sensible programming and the swap in approach had to take complete benefit of this sort of improvement.
Chapter 18: Case examine: XMLSpec: XSLT is frequently used for rendering records, so the place higher to appear for a case examine than the stylesheets utilized by the W3C to render the XML and XSLT requirements, and others within the similar kinfolk, for demonstrate on the net? The ensuing stylesheets are common of these you'll find in any publishing association that makes use of XML to increase a chain of records with a suitable look-and-feel.
Chapter 19: Case research: A relations Tree: showing a genealogy is one other standard XSLT program. this instance with semi-structured data—a mix of quite advanced facts and narrative text—that might be offered in lots of other ways for various audiences. It additionally exhibits tips to take on one other regular XSLT challenge, conversion of the knowledge into XML from a legacy text-based layout. because it occurs, this makes use of approximately the entire vital new XSLT 2.0 positive factors in a single brief stylesheet. yet one other objective of this bankruptcy is to teach a set of stylesheets doing diversified jobs as a part of a whole program.
Chapter 20: Case examine: Knight's Tour: discovering a path round a chessboard the place a knight visits each sq. with no ever retracing its steps may appear a pretty esoteric software for XSLT, yet it’s an effective way of revealing how even the main advanced of algorithms are in the functions of the language. you'll no longer have to take on this actual challenge, but when you must build an SVG diagram exhibiting development opposed to your venture plan, then the issues won’t be that assorted.
Part IV: Appendices: Appendix A: XPath 2.0 Syntax Summary: Collects the XPath grammar ideas and operator precedences into one position for ease of reference.
Appendix B: errors Codes: an inventory of all of the mistakes codes outlined within the XSLT and XPath language standards, with short factors that will help you comprehend what’s long gone unsuitable.
Appendix C: Backward Compatibility: The checklist of items you want to glance out for whilst changing functions from XSLT 1.0.
Appendix D: Microsoft XSLT Processors: even if the 2 Microsoft XSLT processors don’t but aid XSLT 2.0, we concept many readers might locate it beneficial to have a brief precis the following of the most items 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 specific aid but for XSLT 2.0, yet Java programmers will frequently be utilizing it in XSLT 2.0 tasks, so the ebook contains an outline of the periods and strategies on hand.
Appendix F: Saxon: on the time of writing Saxon (developed by way of the writer of this publication) offers the main entire implementation of XSLT 2.0 and XPath 2.0, so its interfaces and extensions are lined in a few aspect.
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 atmosphere or as a freestanding part. This appendix supplies information of its interfaces.
Appendix H: Glossary
Note: CD-ROM/DVD and different supplementary fabrics aren't incorporated as a part of e-book file.