Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

XML Path Language (XPath) functions are used to evaluate expressions.

Each function in the function library is specified using a function prototype that gives the return type, function name, and argument type. If an argument type is followed by a question mark, the argument is optional; otherwise, the argument is required. Function names are case-sensitive.

The following table shows the function groups used by XPath.

Function group Description

XPath String Functions

Performs evaluations, formatting, and manipulation on string arguments.

XPath Number Functions

Evaluates the argument expressions to obtain a numeric result.

XPath Boolean Functions

Evaluates the argument expressions to obtain a Boolean result.

XPath Node-Set Functions

Takes a node-setargument, returns a node set, or returns/provides information about a particular node within a node set.

XSLT Functions

Additions to the core XPath function library.

Examples

Find all text children of author elements.

Copy Code
author/text()

Find all elements that have text node or CDATA node children.

Copy Code
*[text()]

Find the last author for each book.

Copy Code
book/author[last()]

See Also

Reference

XQL Reference

Other Resources

XML Query Language (XQL)