-
Notifications
You must be signed in to change notification settings - Fork 22
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
Node with space in the middle of the key is not located #54
Comments
We run into this as well:
|
A workaround is to change the blank delimiter to something else by
json_setDelimiter() .. But is is on our list so you can escape any char
this ways with double quotres:
txt = json_getValue(p2:'"valid key"');
and more obvious:
txt = json_getValue(p2:'/root/"valid key"/"funny array name"[123]."another
name with blanks"');
…On Thu, May 11, 2023 at 10:41 AM Wim Jongman ***@***.***> wrote:
We run into this as well:
**free
Ctl-Opt BndDir('NOXDB') dftactgrp(*NO) ACTGRP('QILE' );
/include qrpgleref,JSONPARSER
dcl-s p2 pointer;
dcl-s txt varchar(50);
// fail
p2 = json_parseString('{"valid key": "test"}');
txt = json_getValue(p2:'valid key');
dsply txt;
json_delete(p2);
// success
p2 = json_parseString('{"validkey": "test"}');
txt = json_getValue(p2:'validkey');
dsply txt;
json_delete(p2);
*inlr = *on;
—
Reply to this email directly, view it on GitHub
<#54 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVIPHX2BCNB4BA23QM7Z4TXFSQ4DANCNFSM5EGQBEUA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
That does not work, unfortunately. Or I did not understand your instructions:
|
Sorry , i was not clear;
Look at this sample:
https://github.com/sitemule/noxDB/blob/master/examples/JSONPARS2E.JSON-Parse-String-names-with-dots.rpgle
Basically you can change all delimiters in noxDb - also the blank:
The default is:
///
// Default delimiters for JSON and XML data strings.
///
Dcl-C JX_DELIMITERS const('/\@[] .{}''"$');
So you can replace the blank in the path to be vertical line
json_setDelimiters(''/\@[]|.{}''"$'););
.. not easy to see but I changed the sixth character from blank to a
vertical line;
…On Thu, May 11, 2023 at 12:48 PM Wim Jongman ***@***.***> wrote:
That does not work, unfortunately. Or I did not understand your
instructions:
**free
Ctl-Opt BndDir('NOXDB') dftactgrp(*NO) ACTGRP('QILE' );
/include qrpgleref,JSONPARSER
dcl-s p2 pointer;
dcl-s txt varchar(50);
// fail
p2 = json_parseString('{"valid key": "test"}');
txt = json_getValue(p2:'"valid key"');
dsply txt;
json_delete(p2);
// success
p2 = json_parseString('{"validkey": "test"}');
txt = json_getValue(p2:'"validkey"');
dsply txt;
json_delete(p2);
*inlr = *on;
—
Reply to this email directly, view it on GitHub
<#54 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVIPHTPO7YYHBZH2ASOUSDXFS7YPANCNFSM5EGQBEUA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Node with the key "city charter" is not located with
jx_locate(json : 'city charter')
.Unit test NOXDBUT3 test case TEST_KEY_WITH_SPACE.
The text was updated successfully, but these errors were encountered: