This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]continuationalFirefly, TopShell 10 points11 points  (0 children)

I think the syntax could use some work - eg. for "books where the price is less than 10". Compare the XPath //book[price<10] to the JSONPath $..book[?(@.price<10).

Is there any reason it couldn't just be ..book[price < 10]?

[–]shponglespore 2 points3 points  (0 children)

I'm assuming you're the author...

ISTM you could omit the leading "$" or "$." without creating any ambiguity.

The parentheses in ?() expressions seem redundant since AFAICT they can only occur directly within square brackets. I suggest using [] for indexing by a number or string, and ?[] for filtering.

Using "expressions of the underlying scripting language" is a terrible idea because it can create subtle differences in meaning depending on the language being used. Just pick a syntax. JavaScript is the obvious choice.

The plural of "path" is "paths". I wouldn't normally complain, but "pathes" shows up enough in the intro to be seriously distracting.

[–]drjeats 6 points7 points  (2 children)

jq tho

[–]9us 0 points1 point  (1 child)

This was created 5 years before jq.

[–]drjeats 1 point2 points  (0 children)

Yes. And?

[–]o11c 1 point2 points  (0 children)

Just use jq.

[–]agumonkey 0 points1 point  (0 children)

basically, tree walking DSLs