- 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
- Using XSLT and JavaScript in the Internet Explorer
- 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
What Does XML Look Like in a Browser?
You can use a browser such as the Microsoft Internet Explorer, version 5 or later, to display raw XML documents directly. For example, if I saved the XML document we just created in a document named greeting.xml, and opened that document in the Internet Explorer, you'd see something like Figure 1.1.
Figure 1.1 An XML document in the Internet Explorer.
You can see the complete XML document in Figure 1.1. There's no particular formatting at all; the XML document appears in the Internet Explorer just as it does when you might print it out on a printer. (In fact, the Internet Explorer default stylesheet for XML documents was used for the screen shown in Figure 1.1. The stylesheet converts XML into Dynamic HTML, which the Internet Explorer knows how to use.) But what if you want to present the data in a different way? For example, what if you want to present the data in planets.xml in an HTML document as an HTML table?
This is where XSLT transformations enter the picture. We'll take a look at them first in this chapter. At the end of this chapter, we'll take a look at the other side of XSL, XSL-FO.