Chapter 10. XPath 2.0 String Functions

Working on Strings

This chapter is all about the XPath 2.0 string functions. XPath 2.0 now includes support for regular expressions, which let you match strings and work with the text in them, as we'll see in this chapter.

The functions in this chapter work on operands of type xs:string and types derived from xs:string. There are a number of general-purpose functions that work on strings in XPath 2.0, and we'll begin with them:

  • fn:compare compares two or more strings.

  • fn:concat joins two or more strings.

  • fn:string-join joins strings using an optional separator.

  • fn:starts-with returns true if a string begins with a specified ...

Get XPath: Navigating XML with XPath 1.0 and 2.0 Kick Start now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.