XSLT and XQuery

 

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.

The classes in this course will show you what you need to put XSLT and XQuery to work, as we look at efficient and effective development practices, how to write test-driven XSLT applications, and where XSLT, XQuery, and related technologies best fit into the application architecture of a larger system.

Because the “Hands-on Introduction to XML” course will provide introductory material on XSLT and XQuery, classes in this course will focus on helping existing XSLT and/or XQuery developers get the most out of their code and their development time.

Faculty Board member Priscilla Walms­ley teaches, as well as Faculty members Adam Retter, Florent Georges, Tony Gra­ham, and Dr. Jeni Tennison.

Classes for 2012

Adding Structure to Content Using XSLT 2.0

Taught by Priscilla Walmsley.

When you repurpose existing data and content for use in Web and/or Mobile applications, eBook readers, or other uses requiring structured markup, you often need to infer and add that structure to your documents. The advanced regular expression and grouping capabilities of XSLT 2.0, among other features, make it an excellent language for converting and enhancing content. In this class, we will look at the features of XSLT 2.0 that are most useful when you convert unstructured or semi-structured content to a more structured vocabulary and work through several common scenarios. Attendees are invited to contribute examples of their real-world conversion scenarios either before or during the session.

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.

Developing and Testing in XSLT

Taught by Jeni Tennison and Tony Graham

Unit tests, profiling, debugging and, increasingly, test-driven development are part of the bread and butter of working with other programming languages but are not always so with XSLT or XQuery. In test-driven development, which is a fundamental part of agile approaches to software development, the developers write tests that describe the desired behaviour of their application, then write code that meets the tests. This style of development keeps code focused, avoids breaking existing code and facilitates refactoring.

In this session, Jeni Tennison and Tony Graham will describe both the state of the art in testing and debugging XSLT and XQuery and how test-driven development applies to XSLT and XQuery development. In particular, they will focus on the use of the XSpec testing framework.

Trends in XSLT/XQuery

Taught by Florent Georges

XSLT 3.0 and XQuery 3.0 are going to come with a lot of new, powerful features. Expected to be released by the end of the year (XSLT more likely in 2013), this version 3.0 will bring those new tools to the XML developers.

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 Florent will introduce 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 instruction. As the final specifications have not been released yet, those features might still change, even though some are very stable now. This introduction will give you an overview of the new features that you will be able to use soon. Processors even implement some of them already!

The class will also cover XProc, the W3C XML Pipeline language for describing operations to be performed on XML documents. Released in May 2010, XProc was the missing piece in the XML stack. Every time you used more than one XML technology, you had to use another language, like Java or .NET, in order to glue them together. You then had to know the APIs very well and to be careful in connected all the pieces together, again and again. XProc allows you to describe your processing as a network of steps, between which flows your XML documents. XProc describes the processing in a declarative way. No more micro plumbing needed in other languages, just use XProc for your pipelining needs!