When a data file is small, you can find what you need by reading it. When it has thousands of lines and a dozen levels of nesting, reading does not scale. Query languages solve this: instead of scrolling, you describe the path to the value you want and let the tool find it. JSONPath does this for JSON, and XPath does it for XML. ParseLab Pro supports both, returning results with their exact locations so you can jump straight to them.
JSONPath Basics
JSONPath expressions start at the root with `$` and walk down into the structure. `$.database.name` selects the `name` field inside the `database` object. Brackets index into arrays — `$.servers[0].host` is the host of the first server — and the wildcard `*` selects every element at a level, so `$.servers[*].host` returns every server host. These few building blocks cover the majority of real lookups: drilling into a known path, or pulling one field out of every item in a list.
XPath for XML
XPath plays the same role for XML, but its model is built around elements, attributes, and nesting. A path like `/config/database/host` walks the element tree, `//host` finds every `host` element anywhere in the document, and `@` selects attributes — `//server/@port` returns the `port` attribute of every `server`. XPath is older and more expressive than JSONPath, with predicates and functions for filtering, which makes it well suited to the document-shaped data XML tends to hold.
Why Path Queries Beat Text Search
A plain text search for "host" matches comments, similarly named keys, and values that merely contain the word. A path query matches structure: it returns only the `host` fields at the position you asked for. That precision matters most in exactly the files where it is hardest to navigate — large API responses, sprawling infrastructure definitions, and deeply nested configuration.
Querying on the Go
In ParseLab, you can run text, regex, or structural path queries against any open file and get back results tagged with JSONPath-style locations like `$.database.name`. Tap a result to jump to it in the editor or tree view. It turns a large, unfamiliar file from something you have to read into something you can interrogate — right from your phone.