Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Looks like an inferior subset of XPath which is much cleaner and powerful


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: