-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentations for .. operator #1337
Comments
Hmmm, how about:
|
Very good. I will reuse this tread for other documentation confusing aspects:
Thanks in advance for your attention. |
To be absolutely pure, we have just these types of things in jq:
Some of these things look like "operators": So perhaps we can say we have three kinds of things:
Am I missing anything? |
See #1340 for modest improvements related to this. |
I found the basic example for recursive decent to be be inadequate for translating a basic xpath query. Xml Example<?xml version="1.0" encoding="UTF-8"?>
<Operations>
<Operation>
<Source>
<Url>"http://example.com/source"</Url>
</Source>
<Target>
<Url>"http://example.com/target"</Url>
</Target>
</Operation>
</Operations> The query JSON Example{
"operations": [
{
"source": {
"url": "http://example.com/source"
},
"target": {
"url": "http://example.com/target"
}
}
]
} From the documentation it sounds like you would translate that query to something like One might then try adding the As such the I think this more accurately implements the example XPath:
If you're not expecting the property to have an explicit null value it can be shortened to:
Though in both cases this is a lot more verbose and awkward than the http://www.xpathtester.com/xpath/c20db524c674d186e188c454794fd34d |
The document for the operator has been improved in 9b21790 so closing. |
If you follow the description for the operator
..
in the manual you are redirected to the definition ofrecurse
, then torecurse(.[]?)
, then torecurse(f; . != null)
...I propose the following equivalence:
..
Short-hand for
., .[]?, (.[]?|.[]?), (.[]?|.[]?|.[]?), ...
.The text was updated successfully, but these errors were encountered: