Chapter 8. JXPath
JXPath allows you to traverse complex graphs of objects quickly and tersely, using the W3C standard XPath syntax (http://www.w3.org/TR/xpath, and a tutorial is available at http://www.w3schools.com/xpath/). Although XPath was originally designed to provide a standardized mechanism for dealing with complex XML documents, JXPath extends the XPath syntax to support dealing with a wide variety of complex Java data types.
To understand the use of JXPath, start by considering a simple hierarchical structure of people. These people are described by Java objects based on the Person class, as shown in Figure 8-1. Notice that each Person has a gender at a minimum and optionally a mother, father, and children.
Figure 8-1. Person class.
Given ...
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