spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / authoring / languages / xml / insidexslt / chap2 / 2 To page 1To page 2To page 3To page 4current page
[previous]

Inside XSLT

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

Top-Level Stylesheet Elements

XSL defines a number of top-level elements that can be direct child elements of <xsl:stylesheet>:

The XSLT 1.1 working draft adds one more top-level element:

You'll see all these official top-level XSLT elements in this book.

Note that in addition to all these top-level elements, you can also use normal XML comments throughout, because XSLT stylesheets are also XML documents:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

   <!-- This template matches all PLANETS elements -->

   <xsl:template match="/PLANETS">
       <HTML>
           <HEAD>
            .
            .
            .

In addition to the official top-level elements, several XSLT processors define their own top-level elements, and those elements use namespaces that are not the same as the XSL namespace. What these implementer-defined top-level elements do is up to the creator of the XSLT processor.

You can also define your own top-level elements, called user-defined top-level elements. These elements must have a different namespace from XSL and implementer-defined top-level elements. The XSLT processor ignores user-defined top-level elements, but because you can gain access to the whole document yourself with the document function (which you'll see in Chapter 8), you can make use of these elements yourself.

Of all the top-level elements, the most popular is the <xsl:template> element:

<?xml version="1.0">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

   <xsl:template>
    .
    .
    .
   </xsl:template>
    .
    .
    .

Creating and using templates is the very heart of XSLT, and I'll take a look at that element next, as we continue writing planets.xsl.


home / authoring / languages / xml / insidexslt / chap2 / 2 To page 1To page 2To page 3To page 4current page
[previous]


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger

Created: September 20, 2001
Revised: September 20, 2001


URL: http://webreference.com/authoring/languages/xml/insidexslt/chap2/2/5.html