Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


XSLT, XPath and XSL Formatting Objects

Extensible Stylesheet Language (XSL) Version 1.0 became a W3C Recommendation on October 15, 2001 after several years of development. It augments the flexibility of the XML (Extensible Markup Language) standard. XSL is a far more sophisticated style language than is CSS. XSL draws on earlier specifications including CSS and DSSSL. According to the W3C's XSL page, Extensible Stylesheet Language (XSL) is a language for expressing stylesheets consisting of three parts:
  1. a language for transforming XML documents: XSLT
  2. an XML vocabulary for specifying formatting semantics: XSL, sometimes called XSL-FO (Extensible Stylesheet Language Formatting Objects; aka XSL-FO, XSL:FO or XSL FO)
  3. a syntax for addressing parts of a document: XPath, a syntax which is also significant in XPointer and to the emerging XQuery, an XML query language.
"An XSL stylesheet specifies the presentation of a class of XML documents by describing how an instance of the class is transformed into an XML document that uses the formatting vocabulary." In other words, a stylesheet tells a processor how to convert logical structures (the source XML document represented as a tree) into a presentational structure (the result tree). Note that an XSL stylesheet is actually an XML document!

In terms of XML Namespaces, these correspond to <xsl:> [you might sometimes see the synonymous prefix <xslt:> or <transform:>] and <fo:>, for transformations and formatting objects, respectively. For example:

 <?xml version='1.0'?>
 <xsl:stylesheet
 xmlns:xsl=
   "http://www.w3.org/1999/XSL/Transform"
 xmlns:fo=
   "http://www.w3.org/1999/XSL/Format"
 result-ns="fo"
 indent-result="yes">
   <xsl:template match='/'>
    <fo:basic-page-sequence
      font-family="serif">
     <fo:simple-page-master
     page-master-name='scrolling'/>
     <fo:queue queue-name='body'>
      <xsl:apply-templates/>
     </fo:queue>
    </fo:basic-page-sequence>
   </xsl:template>

   <xsl:template match="title">
    <fo:block font-weight="bold">
     <xsl:apply-templates/>
    </fo:block>
   </xsl:template>
 <!-- Parts omitted;
 W3C XSLT spec has complete examples. -->
 </xsl:stylesheet>
	
It is important to understand that the transformation part can be used independently of the formatting semantics. Common transformations include converting XML to HTML, changing the order of elements, and selectively processing elements. In fact, as of early 2002, the majority of XSL implementations support only the transformation part; many do not yet address the formatting objects at all! This may be confusing if you view XSL as mainly for rendering style. However, tools that support XSL-FO are likely to appear rapidly throughout 2002. (See also our XSLT and XPath History page, which tracks the confusing history of the Extensible Stylesheet Language.)

Last Modified:     July 9, 2002

XSLT and XSL-FO Starting Points

What are XSLT and XPath?
This page describes XSLT and XPath, and also tracks the confusing history of the Extensible Stylesheet Language.

What's New in XSLT 2.0?
This article by Evan Lenz from April 2002 describes the features of the next version of XSLT which is not yet a W3C Recommendation. Elliott Rusty Harold gave a related presentation entitled XSLT 2.0 and Beyond (Feb. 2002) which covers both XSLT and XPath 2.0.

What's New in XPath 2.0?
This article by Evan Lenz from March 2002 describes the features of the next version of XPath which is not yet a W3C Recommendation.

XML Query
According to the W3C XML Query home page, the "mission of the XML Query working group is to provide flexible query facilities to extract data from real and virtual documents on the Web, therefore finally providing the needed interaction between the web world and the database world. Ultimately, collections of XML files will be accessed like databases."

TransQuery
TransQuery, XSL Transformations as Query Language, is a set of XSLT conventions and processing model constraints for using XSLT as a query language over multiple XML documents. The purpose is to promote interoperability between XML document management systems (and XML databases) that use XSLT as their primary data access language.

News Items
Check xmlhack for XSLT/XPath news and XSL-FO news items.

XSL, XPath, and XSL-FO Tutorials
A number of online XSL, XPath, and XSL-FO Tutorials are available:

A few XSL tutorials are based on old versions of the XSL Working Draft and are therefore obsolete. They're included here for historical reference.

XSLT and XSL-FO Books, Articles and Papers

XSL Specifications from the W3C
The current Extensible Style Language spec is a lengthy XSL Recommendation from the World Wide Web Consortium (W3C). In April 1999, the tree transformations portion of the XSL Working Draft became a separate document, XSL Transformations (XSLT). See the history.

The following documents are completed W3C Recommendations (or requirements that have been met):

Work on XSL Transformations (XSLT) Version 1.1 was stopped on Aug. 24, 2001, instead favoring XSLT 2.0 development (to subsume XSLT 1.1 Requirements). Working Drafts currently under development include:

Note: Extensive syntax changes were instituted in the August 1998 version of the XSL Working Draft. Be aware that all books, tutorials, articles and examples prior to that time do not reflect the correct syntax.

W3C's Extensible Stylesheet Language Home Page
The W3C XSL home page is a major source of XSL information. It includes sections on:

  • XSL News (includes updates to XSL tools)
  • Tutorials
  • Specs
  • Implementations
  • Reference
  • Articles
  • Mailing Lists
See also the W3C Style Sheets Activity page.

XSL FAQs and References

XSL Software and Related Resources
In addition to the current WDVL XSL page, the following sites are major sources of XSL information:

Selected XSLT and XSL-FO Tools

XSLT Quickly: Part 3
This third and final installment of XSLT Quickly exams element and attribute manipulation, attribute value templates, and ends with a summary of the tutorial.

XSLT Quickly: Part 2
This second installment looks at a simple XSLT stylesheet, template rules, and running an XSLT processor. XSLT Quickly is, quite obviously, for anyone who needs to learn XSLT quickly.

XSLT Quickly: Part 1
XSLT Quickly is, quite obviously, for anyone who needs to learn XSLT quickly. This first installment covers XSLT and alternatives.

Getting Up to Speed with XSLT
The folks at Apache XML Project have a useful list of XSLT resources on their page for xalan, their XSLT processor.

XSL Training
XSL training can be obtained from:

See also WDVL's XML-related Training page. (Vendors of such XSL training materials may submit additions or corrections to Ken Sall for consideration.)

Gallery of Stupid XSLT Tricks
Incremental Development's Gallery of Stupid XSLT Tricks: Fun and Games with XSLT provides real examples of XSLT transformations with detailed explanations of how they work.

XSL Formatting Objects Mailing List
"XSL Formatting Objects are an emerging standard from the W3C. At present there are few tools which do anything with XSL-FO and, until recently, none which will display XSL-FO natively on screen. Some early releases of useful XSL-FO tools are now beginning to emerge." To access the messages, you must subscribe, which also gives you access to XSL-FO Links.

XSL Mailing List Archive
Mulberry Technologies hosts technical discussions of XSL for developers, established April 1997. To subscribe to the XSL list, send mail to: majordomo@mulberrytech.com
In the body of the message put:
subscribe XSL-List
Post messages to: XSL-List@mulberrytech.com


Submit additions or corrections to Ken Sall for consideration.



Up to => Home / Authoring / Languages




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers