Hacker News new | ask | show | jobs
by Kip9000 2586 days ago
Looks like an inferior subset of XPath which is much cleaner and powerful
1 comments

Isn't XPath for XML? How would you use it with JSON?
Xpath’s relationship to XML is like CSS to HTML: its natural domain—and most common use—is XML. However, it is a general path selection/query mechanism with a UNIX-file-path-like syntax.
There are large parts of XPath which are XML specific, like attributes or namespaces or node names (JSON’s arrays of arrays have neither). I am sure with enough effort one could use Xpath for generic JSON queries, but this will require non-obvious redesign of the language.