Chapter 11
XPath Data Types and Functions
In This Chapter
Nodeset functions
String functions
Number functions
Boolean functions
General purpose XSLT functions
T he very first words I could read as a child were free inside.
Everyone likes to get something for free, and with XSLT, you get a host of built-in functions for free inside XPath and XSLT. These functions give you a power boost that you can use when you create stylesheets.
Most of the built-in functions are categorized by the kind of data that they work with. The four primary data types in XSLT are: node sets, strings, numbers, and booleans. In this chapter, you find out all about the major built-in functions for these data types and about some general-purpose functions.
Throughout the chapter, I refer to the following menu.xml source document in Listing 11-1 to demonstrate the use of built-in functions.
Listing 11-1: menu.xml
<?xml version=”1.0”?>
<menu>
<entree name=”Sunburnt Chicken”>
<diet>false</diet> ...
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