Trees and Nodes

When you’re working with XSLT, you no longer think in terms of documents, but rather in terms of trees. A tree represents the data in a document as a set of nodes—elements, attributes, comments, and so on are all treated as nodes—in a hierarchy, and in XSLT, the tree structure follows the W3C XPath recommendation (www.w3.org/TR/xpath). In this chapter, I’ll go through what’s happening conceptually with trees and nodes, and in Chapters 3 and 4, I’ll give a formal introduction to XPath and how it relates to XSLT. You use XPath expressions to locate data in XML documents, and those expressions are written in terms of trees and nodes.

In fact, the XSLT recommendation does not require conforming XSLT processors to have anything to ...

Get Inside XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.