diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2019-02-09 17:07:23 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2019-02-11 00:16:09 +0000 |
commit | e661a29c6c38215e205f595a8ed1aedaf3a963ed (patch) | |
tree | 9751926f9e667e485bfca607c19db15afa1e7bd1 /doc | |
parent | 95938464602a39d9307550d3bd567030ffaf5b4e (diff) |
JSON: add jsons extract variant, to strip quotes from string results
Diffstat (limited to 'doc')
-rw-r--r-- | doc/doc-docbook/spec.xfpt | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index c40cf23f8..d3de8763f 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -9537,6 +9537,8 @@ This forces an expansion failure (see section &<<SECTforexpfai>>&); {<&'string2'&>} must be present for &"fail"& to be recognized. .vitem "&*${extract json{*&<&'key'&>&*}{*&<&'string1'&>&*}{*&<&'string2'&>&*}&&& + {*&<&'string3'&>&*}}*&" &&& + "&*${extract jsons{*&<&'key'&>&*}{*&<&'string1'&>&*}{*&<&'string2'&>&*}&&& {*&<&'string3'&>&*}}*&" .cindex "expansion" "extracting from JSON object" .cindex JSON expansions @@ -9551,8 +9553,13 @@ The expanded <&'string1'&> must be of the form: The braces, commas and colons, and the quoting of the member name are required; the spaces are optional. Matching of the key against the member names is done case-sensitively. -If a returned value is a JSON string, it retains its leading and +For the &"json"& variant, +if a returned value is a JSON string, it retains its leading and trailing quotes. +.new +For the &"jsons"& variant, which is intended for use with JSON strings, the +leading and trailing quotes are removed. +.wen . XXX should be a UTF-8 compare The results of matching are handled as above. @@ -9590,6 +9597,8 @@ empty (for example, the fifth field above). .vitem "&*${extract json{*&<&'number'&>&*}}&&& + {*&<&'string1'&>&*}{*&<&'string2'&>&*}{*&<&'string3'&>&*}}*&" &&& + "&*${extract jsons{*&<&'number'&>&*}}&&& {*&<&'string1'&>&*}{*&<&'string2'&>&*}{*&<&'string3'&>&*}}*&" .cindex "expansion" "extracting from JSON array" .cindex JSON expansions @@ -9598,8 +9607,13 @@ apart from leading and trailing white space, which is ignored. Field selection and result handling is as above; there is no choice of field separator. -If a returned value is a JSON string, it retains its leading and +For the &"json"& variant, +if a returned value is a JSON string, it retains its leading and trailing quotes. +.new +For the &"jsons"& variant, which is intended for use with JSON strings, the +leading and trailing quotes are removed. +.wen .vitem &*${filter{*&<&'string'&>&*}{*&<&'condition'&>&*}}*& |