By Michael Kay
This publication is basically a pragmatic reference e-book for pro XSLT builders. It assumes no earlier wisdom of the language, and plenty of builders have used it as their first creation to XSLT; even though, it's not dependent as an educational, and there are different books on XSLT that supply a gentler process for novices.
The publication does imagine a simple wisdom of XML, HTML, and the structure of the net, and it's written for skilled programmers. There’s no assumption that you just comprehend any specific language comparable to Java or visible easy, simply that you simply realize the thoughts that each one programming languages have in universal.
The booklet is appropriate either for XSLT 1.0 clients upgrading to XSLT 2.0, and for beginners to XSLT. The publication is additionally both appropriate no matter if you're employed within the Java or .NET global.
As befits a reference booklet, a key objective is that the insurance might be entire and authoritative. it really is designed to offer you all of the info, not only an summary of the 20 percentage of the language that the majority humans use eighty percentage of the time. It’s designed so you will continue coming again to the ebook everytime you come upon new and demanding programming initiatives, now not as a ebook that you just skim speedy after which go away at the shelf. should you like aspect, you are going to take pleasure in this booklet; if no longer, you possibly won’t.
yet in addition to giving the element, this publication goals to provide an explanation for the techniques, in a few intensity. It’s consequently a booklet for those who not just are looking to use the language yet who additionally are looking to know it at a deep point.
The ebook goals to inform you every thing you want to find out about the XSLT 2.0 language. It provides 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 e-book is set the language, no longer approximately particular items. although, there are appendices approximately Saxon (the author’s personal implementation of XSLT 2.0), concerning the Altova XSLT 2.0 implementation, and concerning the Java and Microsoft APIs for controlling XSLT variations, that allows you to doubtless be upgraded to deal with XSLT 2.0 in addition to 1.0. a 3rd XSLT 2.0 processor, Gestalt, used to be published presently sooner than the ebook went to press, too overdue to explain it in any element. however the adventure 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 in every of them, then you definitely can use all of them.
within the earlier version we break up XSLT 2.0 and XPath 2.0 into separate volumes. the assumption was once that a few readers can be drawn to XPath on my own. besides the fact that, many received the XSLT 2.0 publication with no its XPath significant other and have been left pressured 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 if you happen to use XPath in contexts except XSLT.
The publication doesn't disguise XSL Formatting items, an immense topic in its personal correct. Nor does it disguise XML Schemas in any aspect. that allows you to use those very important applied sciences along side XSLT, there are different books that do them justice.
This publication includes twenty chapters and 8 appendixes (the final of that's a thesaurus) geared up into 4 elements. the next part outlines what you will discover in each one half, bankruptcy, and appendix.
Part I: Foundations: the 1st a part of the booklet covers crucial strategies. you 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 for those who get to that trough of depression if you happen to locate it very unlikely to make the language do whatever however the such a lot trivial projects. XSLT isn't the same as different languages, and to make it be just right for you, you must know how it used to be designed for use.
Chapter 1: XSLT in Context: This bankruptcy explains how XSLT matches 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 uncomplicated 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 information version. knowing the information version could be crucial factor that distinguishes an XSLT professional from an beginner; it could possibly 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 set writing stylesheets, and this bankruptcy takes a bird’s eye view of what stylesheets seem like. It explains the main ideas of rule-based programming utilizing templates, and explains easy methods to adopt programming-in-the-large by way of structuring your software utilizing modules and pipelines.
Chapter four: Stylesheets and Schemas: A key innovation in XSLT 2.0 is that stylesheets can benefit from wisdom concerning the constitution of your enter and output files, supplied within the type of an XML Schema. This bankruptcy presents a brief evaluation of XML Schema to explain its influence on XSLT improvement. now not everybody makes use of schemas, and you'll bypass this bankruptcy if you happen to fall into that classification.
Chapter five: the sort System: XPath 2.0 and XSLT 2.0 provide powerful typing as a substitute to the vulnerable typing technique of the 1.0 languages. which means you could claim the kinds of your variables, capabilities, and parameters, and use this knowledge to get early caution of programming error. This bankruptcy explains the knowledge kinds on hand and the mechanisms for developing user-defined forms.
Part II: XSLT and XPath Reference: This part of the ebook comprises reference fabric, geared up within the wish so you might simply locate what you would like in the event you want it. It’s no longer designed for sequential examining, notwithstanding chances are you'll 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 designated principles for the syntax and semantics of every point, suggestion on utilization, and examples. this is often most likely the a part of the e-book you are going to use most often as you develop into knowledgeable XSLT person. It’s a “no stone unturned” method, in accordance with the assumption that as a qualified developer you want to comprehend what occurs whilst the going will get tricky, not only while the wind is on your course.
Chapter 7: XPath Fundamentals: This bankruptcy explains the fundamentals of XPath: the low-level constructs equivalent to literals, variables, and serve as calls. It additionally explains the context principles, which describe how the overview of XPath expressions is dependent upon the XSLT processing context within which they seem.
Chapter eight: XPath: Operators on Items: XPath bargains the standard variety of operators for acting mathematics, boolean comparability, and so forth. in spite of the fact that, those don’t continually behave precisely as you'll count on, so it’s worthy studying this bankruptcy to determine what’s on hand and the way it differs from the final language that you simply used.
Chapter nine: XPath: direction Expressions: direction expressions are what make XPath specific; they allow you to navigate round the constitution of an XML record. This bankruptcy explains the syntax of course expressions, the thirteen axes for you to use to find the nodes that you simply want, 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 distinct case). one of the most vital operators in XPath 2.0 are those who manage sequences, significantly the
«for» expression, which interprets one series into one other by means of utilising a mapping.
Chapter eleven: XPath: variety Expressions: the kind process used to be defined in bankruptcy five; this bankruptcy explains the operations for you to use to use forms. This contains the
«cast» operation that is used to transform values from one sort to another.A enormous a part of this bankruptcy is dedicated to the specific principles for the way those conversions are performed.
Chapter 12: XSLT Patterns: This bankruptcy returns from XPath to an issue that’s particular to XSLT. styles are used to outline template principles, the essence of XSLT’s rule-based programming process. 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 referred to as from any XPath expression; XSLT 2.0 extends this with a few extra services which are to be had basically whilst XPath is used inside of XSLT. The library has grown immensely in view that XPath 1.0. This bankruptcy presents a unmarried alphabetical reference for a lot of these services.
Chapter 14: commonplace 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 can be mostly by using constructs that take advantage of common expressions. If you’re accustomed to regexes from languages corresponding to Perl, this bankruptcy tells you the way XPath commonplace expressions vary. If you’re new to the topic, it explains it from first ideas.
Chapter 15: Serialization: Serialization in XSLT skill the facility to generate a textual XML rfile from the tree constitution that’s manipulated through 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 at once through an API.
Part III: Exploitation: the ultimate element of the booklet is suggestion and suggestions on find out how to make the most of XSLT to jot down genuine functions. It’s meant to make you not only a reliable XSLT coder, yet a reliable dressmaker too. the way of studying is via learning the paintings of others, so the emphasis here's on sensible case reports.
Chapter sixteen: Extensibility: This bankruptcy describes the “hooks” supplied within the XSLT specification to permit owners and clients to plug in additional performance. the best way this works will differ from one implementation to a different, so we can’t conceal all probabilities, yet one very important element that the bankruptcy does conceal is tips on how to use such extensions and nonetheless retain your code moveable.
Chapter 17: Stylesheet layout Patterns: This bankruptcy explores a couple of layout and coding styles for XSLT programming, beginning with the easiest “fill-in-the-blanks” stylesheet, and lengthening to the whole use of recursive programming within the sensible programming kind, that's had to take on difficulties of any computational complexity. this offers a chance to give an explanation for the pondering in the back of useful programming and the swap in approach had to take complete good thing about this kind of improvement.
Chapter 18: Case research: XMLSpec: XSLT is usually used for rendering files, so the place greater to seem for a case research than the stylesheets utilized by the W3C to render the XML and XSLT necessities, and others within the comparable relations, for show on the net? The ensuing stylesheets are standard of these you'll find in any publishing association that makes use of XML to advance a sequence of records with a suitable look-and-feel.
Chapter 19: Case examine: A family members Tree: exhibiting a genealogy is one other usual XSLT software. this instance with semi-structured data—a mix of relatively complicated facts and narrative text—that should be offered in lots of other ways for various audiences. It additionally indicates tips to take on one other standard XSLT challenge, conversion of the knowledge into XML from a legacy text-based structure. because it occurs, this makes use of approximately all of the very important new XSLT 2.0 gains in a single brief stylesheet. yet one other goal of this bankruptcy is to teach a set of stylesheets doing varied jobs as a part of an entire program.
Chapter 20: Case examine: Knight's Tour: discovering a path round a chessboard the place a knight visits each sq. with out ever retracing its steps might seem a reasonably esoteric program for XSLT, yet it’s a great way of unveiling how even the main complicated of algorithms are in the features of the language. you could now not have to take on this actual challenge, but when you need to build an SVG diagram exhibiting development opposed to your undertaking plan, then the issues won’t be that numerous.
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: mistakes Codes: a listing of the entire errors codes outlined within the XSLT and XPath language requisites, with short reasons that can assist you comprehend what’s long past improper.
Appendix C: Backward Compatibility: The checklist 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 beneficial to have a short precis right here of the most items and techniques 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 e-book comprises an summary of the periods and techniques on hand.
Appendix F: Saxon: on the time of writing Saxon (developed through the writer of this booklet) presents the main finished implementation of XSLT 2.0 and XPath 2.0, so its interfaces and extensions are coated in a few aspect.
Appendix G: Altova: Altova, the builders of XML secret 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 provides info of its interfaces.
Appendix H: Glossary
Note: CD-ROM/DVD and different supplementary fabrics will not be integrated as a part of booklet file.