Practical mod_perl / HTML Book /



previous page: E.5. XSLT
  
page up: HTML Version of the book
  
next page: E.5.2. Template Rules and Recursion

E.5.1. Anatomy of an XSLT Stylesheet


All XSLT stylesheets contain the following:

  • An XML declaration (optional)

  • An <xsl:stylesheet> element as the document's root element

  • Zero or more template rules

Consider the following bare-bones stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">
  <xsl:template match="/">
    <!-- the content for the output document contained here -->
  </xsl:template>
</xsl:stylesheet>

Note that the root template (defined by the match="/" attribute) will be called without regard for the contents of the XML document being processed. As such, this is the best place to put the top-level elements that we want to include in the output of each and every document being transformed with this stylesheet.

 

Continue to:

  • prev: E.5. XSLT
  • Table of Contents
  • next: E.5.2. Template Rules and Recursion







TOP
previous page: E.5. XSLT
  
page up: HTML Version of the book
  
next page: E.5.2. Template Rules and Recursion


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007 StasoSphere.com