Chapter 1. Transforming Documents with XSLT

Extensible Stylesheet Language Transformations, or XSLT, is a straightforward language that allows you to transform existing XML documents into new XML, Hypertext Markup Language (HTML), Extensible Hypertext Markup Language (XHTML), or plain text documents. XML Path Language, or XPath, is a companion technology to XSLT that helps identify and find nodes in XML documents elements, attributes, and other structures.

Here are a few ways you can put XSLT to work:

  • Transforming an XML document into an HTML or XHTML document for display in a web browser

  • Converting from one markup vocabulary to another, such as from Docbook (http://www.docbook.org) to XHTML

  • Extracting plain text out of an XML document for use in a non-XML application or environment

  • Building a new German language document by pulling and repurposing all the German text from a multilingual XML document

This is barely a start. There are many other ways that you can use XSLT, and you'll get acquainted with a number of them in the chapters that follow.

This book assumes that you don't know much about XSLT, but that you are ready to put it to work. Through a series of numerous hands-on examples, Learning XSLT guides you through many features of XSLT 1.0 and XPath 1.0, while at the same time introducing you to XSLT 2.0 and XPath 2.0.

If you don't know much about XML yet, it shouldn't be a problem because I'll also cover many of the basics of XML in this book. Technical terms are usually defined when they first appear and in a glossary at the end of the book. The XML specification is located at http://www.w3.org/TR/REC-xml.html.

Another specification closely related to XSLT is Extensible Stylesheet Language, or XSL, commonly referred to as XSL-FO (see http://www.w3.org/TR/xsl/). XSL-FO is a language for applying styles and formatting to XML documents. It is similar to Cascading Style Sheets (CSS), but it is written in XML and is somewhat more extensive. (FO is short for formatting objects.) Initially, XSLT and XSL-FO were developed in a single specification, but they were later split into separate initiatives. This book does not cover XSL-FO; to learn more about this language, I suggest that you pick up a copy of Dave Pawson's XSL-FO, also published by O'Reilly.



Learning XSLT
Learning XSLT
ISBN: 0596003277
EAN: 2147483647
Year: 2003
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net