Skip to Content
XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
book

XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition

by Michael Kay
May 2008
Intermediate to advanced
1366 pages
40h 56m
English
Wrox
Content preview from XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition

Chapter 9. XPath: Path Expressions

This chapter defines the syntax and meaning of path expressions. Path expressions are the most distinctive feature of the XPath language, the construct that gives the language its name. The chapter also describes other constructs in the language that are closely associated with path expressions, in particular steps and axes and the «union», «intersect», and «except» operators.

Path expressions are used to select nodes in a tree, by means of a series of steps. Each step takes as its starting point a node, and from this starting point, selects other nodes.

Each step is defined in terms of:

  • An axis, which defines the relationship to be followed in the tree (for example, it can select child nodes, ancestor nodes, or attributes)

  • A node test, which defines what kind of nodes are required, and can also specify the name or schema-defined type of the nodes

  • Zero or more predicates, which provide the ability to filter the nodes according to arbitrary selection criteria

Because they are closely associated with processing the results of path expressions, this chapter also describes the operators used to combine two sets of nodes by taking their union, intersection, or difference.

Although I've chosen Path Expressions as the title for this chapter, the term is actually a slippery one. Because of the way W3C defines the XPath grammar, all sorts of unlikely constructs such as «2» or «count($x)» are technically path expressions. The things I will actually cover in this ...

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

Learning XSLT

Learning XSLT

Michael Fitzgerald
XSLT

XSLT

Doug Tidwell
XSLT, 2nd Edition

XSLT, 2nd Edition

Doug Tidwell

Publisher Resources

ISBN: 9780470192740Purchase book