XML technologies / XSLT / Introduction to XSLT 2.0

Introduction to XSLT 2.0

(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapters 1–3.)

The following pages reproduce chapters 1–3 of “XSLT 2.0 & XPath 2.0 ― Das umfassende Handbuch” by Frank Bongers.

Why a book about XSLT?

The simple answer is that the topic is important: XSLT is an independent information-processing standard in the XML family, naturally suited to processing XML data. This is precisely what it was designed for.

XML long ago moved beyond hype and buzzwords to become an accepted standard for industrial information storage, exchange and processing. W3C defined it with extensive industry participation, ensuring broad, now almost ubiquitous support.

XML’s spread increases the need to process its documents independently of platforms. Processing can be written in many programming languages, but without necessarily making those processing rules easily portable.

XSLT provides a solution: platform-independent applications themselves written in XML, stylesheets move almost effortlessly between environments, whether PHP, .NET or Java, using processors such as Saxon or AltovaXML. As environments change, the stylesheet remains a constant. XSLT also has a place in Web 2.0, as frameworks such as Google’s “AJAXSLT” or “Sarissa” show, even though they currently support XSLT 1.0.

XSLT’s tasks are increasingly complex. Much XML processing now involves databases. Ensuring valid input and output introduces new challenges addressed by version 2.0 of XSLT and XPath.

The convergence of databases and XML is reflected in the merging of XPath and XML Query Language into the general XML query language XQuery 1.0, of which XPath 2.0 is only a subset. XSLT will remain central to processing XML data, whether real documents or virtual documents dynamically generated by database queries.

What does the book cover?

The book gives XSLT and XPath equal attention. They are normally used together, although XPath can occur in other environments, so separating them would make little sense.

Both languages are presented in their current version 2.0. Changes from XSLT 1.0 are noted when discussing XSLT 2.0 instructions; the version change mainly extends its predecessor. XPath 2.0/XQuery 1.0, by contrast, is almost a newly designed language, merely backwards compatible, both in scope and in function behaviour. The book is explicitly not a retrospective introduction to XSLT 1.0 and XPath 1.0. No prior knowledge of those versions is required, however. After studying the book, you should also feel comfortable in XSLT 1.0/XPath 1.0 environments. The reference section highlights version differences and possible pitfalls for those migrating. Readers should know XML and have at least basic knowledge of XML Schema. Covering these topics would exceed the already extensive scope, and sufficient literature is available elsewhere.

The full XQuery specification is also outside scope. XPath 2.0 is a significant subset, but the complete XQuery 1.0 language can, at present, only be used separately from XSLT. Since the book takes XSLT’s perspective, describing unavailable XQuery functionality would add unnecessary weight and potential confusion.

   

   

back to top