By Michael Kay
This e-book is basically a pragmatic reference publication for pro XSLT builders. It assumes no prior wisdom of the language, and lots of builders have used it as their first advent to XSLT; notwithstanding, it isn't dependent as an academic, and there are different books on XSLT that supply a gentler method for novices.
The booklet does imagine a easy wisdom of XML, HTML, and the structure of the internet, and it's written for skilled programmers. There’s no assumption that you simply be aware of any specific language equivalent to Java or visible simple, simply that you just realize the suggestions 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 rookies to XSLT. The booklet can be both compatible even if you're employed within the Java or .NET international.
As befits a reference booklet, a key target is that the assurance can be finished and authoritative. it's designed to provide you the entire information, 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 difficult programming initiatives, now not as a e-book that you just skim quick after which go away at the shelf. if you happen to like aspect, you are going to take pleasure in this booklet; if no longer, you possibly won’t.
yet in addition to giving the aspect, this publication goals to provide an explanation for the innovations, in a few intensity. It’s as a result a booklet for those that not just are looking to use the language yet who additionally are looking to are aware of it at a deep point.
The ebook goals to inform you every thing you want to learn about the XSLT 2.0 language. It supplies 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 ready the language, no longer approximately particular items. despite 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 concerning the Java and Microsoft APIs for controlling XSLT adjustments, with a view to without doubt 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 ahead of the booklet went to press, too past due to explain it in any aspect. however the event of XSLT 1.0 is that there was a really excessive point of interoperability among diversified XSLT processors, and if you happen to can use one among them, you then can use all of them.
within the past variation we cut up XSLT 2.0 and XPath 2.0 into separate volumes. the belief was once that a few readers should be attracted to XPath by myself. notwithstanding, many received the XSLT 2.0 e-book with out its XPath significant other and have been left harassed therefore; so this time, the fabric is again jointly. The XPath reference info is in self-contained chapters, so it's going to nonetheless be available if you use XPath in contexts except XSLT.
The publication doesn't disguise XSL Formatting gadgets, a massive topic in its personal correct. Nor does it hide XML Schemas in any element. in an effort to use those vital applied sciences together with XSLT, there are different books that do them justice.
This booklet comprises twenty chapters and 8 appendixes (the final of that's a thesaurus) equipped into 4 components. the subsequent part outlines what you will discover in every one half, bankruptcy, and appendix.
Part I: Foundations: the 1st a part of the e-book covers crucial suggestions. you'll want to learn those prior to you begin coding. if you happen to forget about this recommendation, as most folk do, you then learn them if you get to that trough of melancholy should you locate it most unlikely to make the language do something 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 how it was once designed for use.
Chapter 1: XSLT in Context: This bankruptcy explains how XSLT suits into the large photograph: 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 can be in regards to the structure of an XSLT processor: the inputs, the outputs, and the knowledge version. figuring out the information version could be crucial factor that distinguishes an XSLT professional from an novice; it might appear like info that you just can’t use instantly, yet it’s wisdom that would cease you creating a lot of silly blunders.
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 innovations of rule-based programming utilizing templates, and explains the right way to adopt programming-in-the-large through structuring your program utilizing modules and pipelines.
Chapter four: Stylesheets and Schemas: A key innovation in XSLT 2.0 is that stylesheets can benefit from wisdom in regards to the constitution of your enter and output records, supplied within the type of an XML Schema. This bankruptcy presents a short evaluation of XML Schema to explain its effect on XSLT improvement. now not each person makes use of schemas, and you may bypass this bankruptcy if you happen to 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 data to get early caution of programming mistakes. This bankruptcy explains the knowledge forms to be had and the mechanisms for developing user-defined varieties.
Part II: XSLT and XPath Reference: This element of the publication includes 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 analyzing, notwithstanding 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 components you should use in a stylesheet, in alphabetical order, giving distinctive ideas for the syntax and semantics of every aspect, recommendation on utilization, and examples. this is often most likely the a part of the ebook you'll use most often as you turn into a professional XSLT person. It’s a “no stone unturned” strategy, in response to the assumption that as a qualified developer you want to understand what occurs while the going will get tricky, not only whilst the wind is on your course.
Chapter 7: XPath Fundamentals: This bankruptcy explains the fundamentals of XPath: the low-level constructs similar to literals, variables, and serve as calls. It additionally explains the context principles, which describe how the review 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. although, those don’t continuously behave precisely as you will count on, so it’s worthy analyzing this bankruptcy to work out what’s to be had and the way it differs from the final language that you simply used.
Chapter nine: XPath: course Expressions: direction expressions are what make XPath exact; they allow you to navigate round the constitution of an XML rfile. This bankruptcy explains the syntax of direction expressions, the thirteen axes so that you can use to find the nodes that you simply desire, and linked operators corresponding 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). probably 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 making use of a mapping.
Chapter eleven: XPath: style Expressions: the sort method was once defined in bankruptcy five; this bankruptcy explains the operations that you should use to use kinds. This comprises the
«cast» operation that is used to transform values from one kind to another.A huge a part of this bankruptcy is dedicated to the targeted principles for a 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 ideas, the essence of XSLT’s rule-based programming procedure. the cause of explaining them now's that the syntax and semantics of styles relies strongly at the corresponding ideas for XPath expressions.
Chapter thirteen: The functionality Library: XPath 2.0 incorporates a library of services that may be known as from any XPath expression; XSLT 2.0 extends this with a few extra features which are on hand in basic terms whilst XPath is used inside XSLT. The library has grown immensely because XPath 1.0. This bankruptcy presents a unmarried alphabetical reference for these types of features.
Chapter 14: average 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 principally by utilizing constructs that take advantage of general expressions. If you’re conversant in regexes from languages similar to Perl, this bankruptcy tells you the way XPath typical 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 record 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 an eye on it without delay through an API.
Part III: Exploitation: the ultimate component of the ebook is suggestion and counsel on find out how to make the most of XSLT to put in writing genuine purposes. It’s meant to make you not only a reliable XSLT coder, yet a reliable dressmaker too. the way in which of studying is by way of learning the paintings of others, so the emphasis this is on functional case experiences.
Chapter sixteen: Extensibility: This bankruptcy describes the “hooks” supplied within the XSLT specification to permit proprietors and clients to plug in additional performance. the way in which this works will range from one implementation to a different, so we can’t conceal all percentages, yet one vital point that the bankruptcy does disguise is tips to use such extensions and nonetheless continue 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 entire use of recursive programming within the practical programming kind, that is had to take on difficulties of any computational complexity. this offers a chance to provide an explanation for the considering at the back of practical programming and the swap in frame of mind had to take complete good thing about this variety of improvement.
Chapter 18: Case learn: XMLSpec: XSLT is frequently used for rendering files, so the place higher to appear for a case learn than the stylesheets utilized by the W3C to render the XML and XSLT requirements, and others within the comparable family members, for reveal on the internet? The ensuing stylesheets are commonplace of these you will discover in any publishing association that makes use of XML to advance a sequence of records with a suitable look-and-feel.
Chapter 19: Case learn: A relations Tree: exhibiting a genealogy is one other common XSLT software. this instance with semi-structured data—a mix of relatively complicated information and narrative text—that may be offered in lots of alternative ways for various audiences. It additionally exhibits tips on how to take on one other common XSLT challenge, conversion of the knowledge into XML from a legacy text-based layout. because it occurs, this makes use of approximately all of the vital new XSLT 2.0 good points in a single brief stylesheet. yet one other target of this bankruptcy is to teach a set of stylesheets doing varied jobs as a part of an entire program.
Chapter 20: Case research: Knight's Tour: discovering a path round a chessboard the place a knight visits each sq. with out ever retracing its steps may appear a reasonably esoteric software for XSLT, yet it’s a great way of unveiling how even the main advanced of algorithms are in the services of the language. you could no longer have to take on this actual challenge, but when you need to build an SVG diagram exhibiting growth opposed to your undertaking plan, then the issues won’t be that distinct.
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: blunders Codes: an inventory of all of the blunders codes outlined within the XSLT and XPath language standards, with short reasons that will help you comprehend what’s long gone fallacious.
Appendix C: Backward Compatibility: The record of items you must glance out for while changing purposes from XSLT 1.0.
Appendix D: Microsoft XSLT Processors: even supposing the 2 Microsoft XSLT processors don’t but aid XSLT 2.0, we idea many readers may locate it worthy to have a short precis the following of the most gadgets 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 specific help but for XSLT 2.0, yet Java programmers will frequently be utilizing it in XSLT 2.0 initiatives, so the e-book contains an summary of the periods and strategies to be had.
Appendix F: Saxon: on the time of writing Saxon (developed by way of the writer of this booklet) 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 advance atmosphere or as a freestanding part. This appendix offers information of its interfaces.
Appendix H: Glossary
Note: CD-ROM/DVD and different supplementary fabrics should not incorporated as a part of book file.