XSL: Transformations and Style

Vincent Quint

World Wide Web Consortium

WWW9 - Amsterdam - 18 May 2000

Extensible Stylesheet Language (XSL)

XSL is a language for expressing stylesheets

XSL Architecture

XSL Architecture

XSL Components

XSL is constituted of three main components:

XSL uses XSLT which uses XPath

XSL Transformations

XSL Transformations

XSLT - Basic Principle

Patterns and Templates

An Example: Transformation

<xsl:template match="Title">
   <H1>
      <xsl:apply-templates/>
   </H1>
</xsl:template>

Input : <Title>Introduction</Title>

Output : <H1>Introduction</H1>

An Example: Formatting

<xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:fo="http://www.w3.org/1999/XSL/Format"
     result-ns="fo">
  <xsl:template match="/">
    <fo:page-sequence font-family="serif">
       <xsl:apply-templates/>
    </fo:page-sequence>
  </xsl:template>
  <xsl:template match="para">
    <fo:block font-size="10pt" space-before="12pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>
</xsl:stylesheet>

XPath: XML Path Language

An elementary XPath expression contains

Example: all para children that have a type attribute with value warning

     child::para[attribute::type="warning"]

XSL Usage

XSL may be used server-side or client-side,
but is not intended to send FOs over the wire

Implementations

XSL software include:

XSL and CSS

XSL is not intended to replace CSS, but provides functionality beyond that of CSS

XSL/CSS Common features:

History

XSL is inspired by both CSS and DSSSL (ISO/IEC 10179:1996)

Current Situation

What the Future Holds

Next step: move XSL 1.0 to W3C Recommendation status

New WG proposed to work on new versions of all 3 specifications: XSL, XSLT, XPath

XPath is used in XPointer and XLink, considered by XML Query WG

More information

W3C XSL page: http://www.w3.org/Style/XSL

XSL, XSLT, XPath specifications: http://www.w3.org/TR

Public mailing list: http://www.mulberrytech.com/xsl/xsl-list