Skip to Content
XSLT
book

XSLT

by Doug Tidwell
August 2001
Intermediate to advanced content levelIntermediate to advanced
480 pages
11h 16m
English
O'Reilly Media, Inc.
Content preview from XSLT

XPath Node Tests

XPath defines several node tests that can be used to select nodes from the source tree. Strictly speaking, any XPath expression can be considered a node test; the expression para, for example, selects all <para> elements from the context node. Several special node tests allow you to select nodes that can’t be selected any other way. (Although they look and work like functions, they are technically node tests.) These special node tests are described here:

text()

Selects all the text-node children of the context node.

comment()

Selects all the comment-node children of the context node.

processing-instruction()

Selects all the processing-instruction children of the context node. Unlike the other node tests defined here, processing-instruction() can have an optional argument; processing-instruction('xml-stylesheet') selects all processing instructions with a name of xml-stylesheet.

node()

Is true for all nodes, regardless of type. Using this node test selects all element nodes, attribute nodes, processing-instruction nodes, etc.

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.
Start your free trial

You might also like

Learning XSLT

Learning XSLT

Michael Fitzgerald
Inside XSLT

Inside XSLT

Steven Holzner
XSLT Cookbook

XSLT Cookbook

Sal Mangano

Publisher Resources

ISBN: 0596000537Supplemental ContentCatalog PageErrata