Chapter 8. XSLT

XSLT, Extensible Stylesheet Language Transformations, is a very important XML application in many XML workflows. In many business situations, data is either stored as XML or can be made available from a database as XML. XSLT is important because, typically, the way in which XML is stored needs to be changed before it is used. Wherever the data comes from, the XML might need to be presented to end-users or be shared with business partners in a format that is convenient for them. XSLT plays a key role in converting XML to its presentation formats and restructuring XML to fit the structures useful to business partners.

This chapter covers the following:

  • How XSLT can be used to convert XML for presentation or restructure XML for business-to-business data interchange

  • How XSLT differs from conventional procedural languages

  • An XSLT transformation is described in terms of a source document and a result document. However, under the hood, the transformation taking place is a source tree (which uses the XPath data model) to a result tree (which also uses the XPath data model).

  • How the elements that make up an XSLT stylesheet are used. For example, you look at how to use the xsl:value-of element to retrieve values from the source tree being transformed. In addition, you look at the xsl:copy and xsl:copy-of elements, which, respectively, shallow copy and deep copy nodes from the source tree.

  • How to use XSLT variables and parameters

  • The new features of XSLT 2.0 and how they make transformations ...

Get Beginning XML, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.