tags:

views:

1528

answers:

6

What's the difference between XSLT and XSL-FO ?

Every resource I've read deal with them as if they were 1, or at least very closely tied..

Thanks in advance

A: 

XSLT is a template format that can be used to generate all sorts of documents, including plain text documnent.

XSL-FO denotes the use of XSLT to produce FO documents.

Maurice Perry
Not quite. XSL-FO is an XML vocabulary for specifying the layout and formatting of documents. XSL-FO documents *can* be produced via XSLT, or without XSLT.
LarsH
Also, XSL-FO means the same thing as FO.
LarsH
Alright, sorry about that
Maurice Perry
+1  A: 

What about the Wikipedia definition?

XSL Formatting Objects, or XSL-FO, is a markup language for XML document formatting which is most often used to generate PDFs. XSL-FO is part of XSL, a set of W3C technologies designed for the transformation and formatting of XML data. The other parts of XSL are XSLT and XPath. As of December 12, 2006, the current version of XSL-FO is v1.1.

Manuel
This is not correct anymore, XSL _is_ XSL-FO. XSLT and XPath are however not the same or part of XSL.They arer separate recommendations from W3C.
Björn
Aaah, the confusion :)
cwap
They did start out as part of the same specification when it was in draft form, then they decided to split them into separate specifications. That may have contributed to the confusion(besides the similarities in the acronyms).
Mads Hansen
A: 

XSL-FO stands for Extensible Stylesheet Language Formatting Objects and is about formatting and now is nown as xSL ot avoid all confusion. So do not worry about XSL-FO anymore.

XSLT however is about transforming xML. So it is very clear. XSL is about formatting and XSLT is about transforming.

CodeToGlory
Not quite. XSL-FO *is* still called XSL-FO, and that's the clearest way to refer to it. XSL properly refers to both XSLT and XSL-FO, but if people use it to refer to just one of those, they usually mean XSLT.
LarsH
+3  A: 

XSLT is used for transforming, XSL (which is the same as XSL-FO) is used for formatting.

http://www.w3schools.com/xslfo/xslfo_intro.asp

Björn
This "best answer" is only partially correct and Mads Hansen's, and others below, is the real best answer.
Rob
Agreeing with @Rob. XSLT is a transformation language used for transforming XML. XSL-FO is an XML vocabulary for paged layout and formatting. XSL consists of **both** XSLT and XSL-FO.
LarsH
+7  A: 

I was wondering about the basis of the question because I thought it was easy to answer, however as soon as you go here: http://www.w3.org/TR/xsl/ it becomes clear that its actually a good question - because pretty much the first thing on the page is this statement:

This specification defines the features and syntax for the Extensible Stylesheet Language (XSL), a language for expressing stylesheets. It consists of two parts:

  1. a language for transforming XML documents (XSLT), and
  2. an XML vocabulary for specifying formatting semantics.

However, back in the real world, XSLT (which is also what most people will assume you mean by XSL) is a means for transforming XML documents into something else - that something else more often than not being another well structured document probably also formatted as XML (though I've used XSLT to render XML to csv and plain(ish) text).

XSL-FO on the other hand is about formatting - about laying out content on a page or a sequence of pages in a fairly strict fashion. Its useful because it allows you to manage content that is spread across multiple pages, its relatively straightforward to specify the format of a page (or even and odd pages) including headers, footers, borders, columns, etc and have your content flow into that. One would therefore take a load of data in, say, an XML format and then use XSLT to convert that data into a document consisting of XSL-FO that in turn is rendered using an appropriate tool in say PDF for print or other means of distribution.

The use case I have is to take a pile of tabular data, export that data as XML, render that into XSL-FO and from there to PDF which goes to a printer who turns said PDF into a 500 page directory. One specifies in the XSL-FO that one wants page numbers, page breaks in specific circumstances, that there is a table of contents and an index (each based on particular elements) and the rendering process (to PDF) handles filling in the page numbers across the board.

Hopefully you're a bit less confused now..

Murph
+3  A: 

Asside from the similarities in the acronyms the two technologies used to be part of the same W3C spec(in draft form). It was later decided to split XSL(XSL-fo) and XSLT out into two separate specifications.

Quote from W3Schools:

XSL-FO is Formally Named XSL

Why this confusion? Is XSL-FO and XSL the same thing?

Yes it is, but we will give you an explanation:

Styling is both about transforming and formatting information. When the World Wide Web Consortium (W3C) made their first XSL Working Draft, it contained the language syntax for both transforming and formatting XML documents.

Later, the Working Group at W3C split the original draft into separate Recommendations:

* XSLT, a language for transforming XML documents
* XSL or XSL-FO, a language for formatting XML documents
* XPath, a language for navigating in XML documents

A detailed annotation of the chronology can be found on Dave Pawson's Home page: http://www.dpawson.co.uk/xsl/sect1/history.html

Mads Hansen