to the main page about the tutorial  THE XML REVOLUTION  -  TECHNOLOGIES FOR THE FUTURE WEB back up next

Structure of a stylesheet

An XSLT stylesheet is itself an XML document:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
                xmlns="...">
   .
   .
   .
  <xsl:template match="pattern">   \
    template                        >
a template rule
  </xsl:template>                  /
   .
   .                  
<- other top-level elements
   .
</xsl:stylesheet>

The namespace http://www.w3.org/1999/XSL/Transform is used to recognize the XSLT elements; elements from other namespaces constitute literal result fragments.

A document may refer to a stylesheet using the processing instruction:

<?xml-stylesheet type="text/xsl" href="foo.xsl"?>

Newer browsers contain an XSLT processor.

back COPYRIGHT © 2000-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH next