- Chapter 1: Essential XSLT
- A Little Background
- XML Documents
- What Does XML Look Like in a Browser?
- XSLT Transformations
- Making an XSLT Transformation Happen
- Using Standalone XSLT Processors
- Using Browsers to Transform XML Documents
- XSLT Transformations on Web Servers
- XML-to-XHTML Transformations
- XSLT Resources
- XSL Formatting Objects: XSL-FO
- XSL-FO Resources
- Formatting an XML Document
- The XSLT Stylesheet
- Transforming a Document into FormattingObject Form
- Creating a Formatted Document
Chapter 1: Essential XSLT
Welcome to the world of Extensible Stylesheet Language Transformations, XSLT. This book is your guided tour to that world, which is large and expanding in unpredictable ways every minute. In this book, we're going to make that world your world. There's a lot of territory to cover, because these days XSLT is getting into the most amazing places, and in the most amazing ways. And you're going to see all of it at work in this book.
XSLT is all about handling and formatting the contents of XML documents (the companion volume to this book is Inside XML, New Riders, 2000). XML has become a very hot topic, and now it's XSLT's turn. XML enables you to structure the data in documents, and XSLT enables you to work with the contents of XML documentsmanipulating the content and creating other documents, such as when you sort an XML employee records database or store that data in an HTML document, as well as format that data in a detailed way.
You can work with the contents of XML documents by writing your own programs that interface to XML parser applications, but that involves writing your own code. With XSLT, on the other hand, you can perform the same kinds of tasks, and there's no programming required. Rather than write your own Java, Visual Basic, or C++ to handle the contents of XML documents, you just use XSLT to specify what you want to do, and an XSLT processor does the rest. That's what XSLT is all about, and it's become the next big thing in the XML world.
XSL = XSLT + XSL-FO
XSLT itself is actually part of a larger specification, Extensible Stylesheet Language, or XSL. XSL is all about specifying the exact format, down to the millimeter, of documents. The formatting part of XSL, which is a far larger specification than XSLT is based on special formatting objects, and this part of XSL is often called XSL-FO (or XSL:FO, or XSLFO). XSL-FO is an involved topic, because styling your documents with formatting objects can be an intricate process. In fact, XSLT was originally added to XSL to make it easier to transform XML documents into documents that are based on XSL-FO formatting objects.
This book is all about XSLT, but it also provides an introduction to XSL-FO, including how to use XSLT to transform documents to XSL-FO form; after all, XSLT was first introduced to make working with XSL-FO easier.To get started, this chapter examines both XSLT and XSL-FO in overview.