O'Reilly logo

Special Edition Using XSLT by Michael Floyd

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Style Sheet Structure

Chapter 2 covered the overall structure of a style sheet in detail. However, let’s briefly reexamine the overall structure of a style sheet. Listing 4.1 presents a simple style sheet that transforms an XML document to HTML.

Listing 4.1. This Basic Style Sheet Transforms an XML Document Containing Information About an Invoice—the Transformation Is to HTML
 <?xml version=”1.0” ?> <xsl:stylesheet version=”1.0” xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”> <xsl:output method=”html” /> <!-- Root template rule --> <xsl:template match=”/”> <HTML> <HEAD> <TITLE>First XSLT Example</TITLE> </HEAD> <BODY> <P><B>Company: </B> <xsl:value-of select=”invoice/clientName” /> </P> <P><B>Contact: </B> <xsl:value-of select=”invoice/contact” ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required