© Jeff Friesen 2016

JEFF FRIESEN, Java XML and JSON, 10.1007/978-1-4842-1916-4_10

10. Extracting JSON Values with JsonPath

Jeff Friesen

(1)Dauphin, Manitoba, Canada

XPath is used to extract values from XML documents. JsonPath performs this task for JSON documents. This chapter introduces you to JsonPath.


If you’re unfamiliar with XPath, I recommend that you read Chapter 5 before reading this chapter. JsonPath was derived from XPath.

What Is JsonPath ?

JsonPath is a declarative query language (also known as a path expression syntax ) for selecting and extracting a JSON document’s property values. For example, you can use JsonPath to locate "John" in {"firstName": "John"} and return this value. JsonPath is based on XPath 1.0.

JsonPath was created ...

Get Java XML and JSON now with the O’Reilly learning platform.

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