O'Reilly logo

Apache Jakarta Commons: Reusable Java™ Components by Will Iverson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required