Skip to Content
XSLT, 2nd Edition
book

XSLT, 2nd Edition

by Doug Tidwell
June 2008
Intermediate to advanced
986 pages
27h 8m
English
O'Reilly Media, Inc.
Content preview from XSLT, 2nd Edition

Walking Through Our Example

Let’s revisit our example and see how the XSLT processor transforms our document:

  1. The XSLT stylesheet is parsed and converted into a tree structure.

  2. The XML document is also parsed and converted into a tree structure. Don’t worry too much about what that tree looks like or how it works; for now, just assume that the XSLT processor knows everything that’s in the XML document and the XSLT stylesheet. After the first two steps are done, when we describe various things using XSLT and XPath, the processor knows what we’re talking about.

  3. The XSLT processor is now at the root of the XML document. This is the original context.

  4. There is an xsl:template that matches the document root:

    <xsl:template match="/">
      <xsl:apply-templates select="greeting"/>
    </xsl:template>

    A single forward slash (/) is an XSLT pattern (written in XPath) that matches “document nodes.”

  5. Now the process begins again inside the xsl:template. Our only instruction here is to apply whatever xsl:templates might apply to any greeting elements in the current context. The current context inside this template is defined by the match attribute of the xsl:template element. This means the XSLT processor is looking for any greeting elements at the document root.

    Because one greeting element is at the document root, the XSLT processor must deal with it. (If more than one element matches in the current context, the XSLT processor deals with each one in the order in which they appear in the document; this is known ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

XSLT Cookbook, 2nd Edition

XSLT Cookbook, 2nd Edition

Sal Mangano
XSLT

XSLT

Doug Tidwell
XSLT for Dummies

XSLT for Dummies

Richard Wagner
XSLT Cookbook

XSLT Cookbook

Sal Mangano

Publisher Resources

ISBN: 9780596527211Errata Page