© Jeff Friesen 2019
Jeff FriesenJava XML and JSONhttps://doi.org/10.1007/978-1-4842-4330-5_10

10. Extracting JSON Values with JsonPath

Jeff Friesen1 
(1)
Dauphin, MB, Canada
 

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

Note

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: Document Processing for Java SE now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.