My Blog

XSLT and XQuery 2019


XML makes it possible to store content in a standardized format that can be
converted to a variety of output media using a broad choice of technologies.
Most of these technologies build on related W3C standards with both commercial
and open source tools support. XSLT lets you define a transformation of a set of
documents into a particular format, so that three XSLT stylesheets could create
published products from the same content for three different media. The XQuery
language lets you pull subsets of XML content from huge repositories, so that
XML databases that support XQuery can (among other things) provide dynamic
publications customized for different customers.

If you are looking for introductory material on XSLT and XQuery, you should try
the “Hands-on Introduction to XML” course. Intermediate XSLT developers looking
for more hands-on material should consider the Hands-on Digital
Publishing With XSLT
course. Classes in this course are more advanced
and focus on helping XSLT and/or XQuery developers with more experience get the
most out of their code and their development time.

This course is chaired by Priscilla Walmsley and taught by Adam Retter, Florent Georges, Jirka Kosek, and Priscilla Walmsley.

Classes for 2019

The XSLT and XQuery course runs on

Refactoring XSLT

Taught by Priscilla Walmsley.

A lot of existing XSLT stylesheets are not optimal. They may be performing
poorly, hard to maintain, or not robust enough to handle all use cases. There
are many reasons for this: they might have been developed under time
constraints, built up gradually over time into something overly complex, written
by less experienced developers, or generated from a tool.

In this class, we will take a look at what constitutes a well-designed XSLT
stylesheet, and how to apply good design techniques to existing XSLT stylesheets
to make them more robust and easier to maintain. We will talk about the pitfalls
that developers new to XSLT encounter that could cause problems later on, and
how to spot them. We will look at tools to identify potential stylesheet
weaknesses and automate some of the cleanup.

As a group, we will examine specific examples of XSLT stylesheets and discuss how
to improve them. Students are encouraged to submit XSLT examples that can be
used for this discussion, in order to get constructive feedback.

Querying XML Databases with XQuery

Taught by Adam Retter.

This class will provide an overview of the capabilities and use cases of XML
databases, examining some of the database products that support XML and how they
are being used. It will then cover the role of XQuery among other XML
technologies in the querying of XML databases.

As a group, the class will build a simple search application using XQuery and an
XML database (eXist). This will provide an opportunity for attendees to learn
the syntax and capabilities of XQuery, as well as see it in action. Major
features of the XQuery language such as FLWOR expressions, XML constructors, and
user-defined functions will be explained.

XSLT 3.0 and XQuery 3.0

Taught by Florent Georges.

XSLT 3.0 and XQuery 3.0 come with a lot of new, powerful features.

XPath 3.0 itself comes with one of the most useful of them: function items and
higher-order functions; that is, the ability to manipulate functions and pass
them around, calling them dynamically and define new anonymous inline functions.
XQuery 3.0 has numerous additions on its own, among them grouping, windowing,
try/catch, and private functions. For XSLT 3.0, the biggest addition is the
support for streaming transformation. Florent will also introduce the packages,
the evaluation of dynamically computed XPath expressions, the extension of
template rules to atomic values, the try/catch mechanism and the new xsl:assert

XSLT 3.0 for Daily Coding

Taught by Jirka Kosek.

XSLT 3.0 brings a lot of broad new features, such as streaming processing and
high-order functions. But many existing transformations will not benefit from
these features because they are operating on moderately sized documents and do
not implement complex algorithms.

Instead, they will benefit more from a lot of small XSLT 3.0 features that
improve productivity and readability. Building on the previous session, some of
these incremental, practical improvements will be demonstrated and applied,

  • producing more readable complex XPath expressions by using new
    operators (simple map operator (!), arrow operator (=>), string
    concatenation (||))
  • writing more readable templates using text value templates
  • using xsl:evaluate and shadow attributes to make stylesheets easily
  • replacing recursive template calls and functions with xsl:iterate
  • writing identity transformations without the identity template (xsl:mode)

During the class, attendees will also be refactoring provided simple XSLT 1.0/2.0
transformations into more readable code using XSLT 3.0 in order to get new
features under the skin.