Skip to content
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

Path resolution on TSuperObject #8

Open
GoogleCodeExporter opened this issue Jun 22, 2015 · 0 comments
Open

Path resolution on TSuperObject #8

GoogleCodeExporter opened this issue Jun 22, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Please review the following results when quoting path expressions that may
or may not include namespace notation.

Test #5 shows the expected results. It would be nice if #3 or #4 produced
the same results, but I'm not sure what the SOT path spec says about pseudo
namespaces. 

I was hoping that quoted or escaped path notation from via the root SO
would work.

--- 1

    str := '{ "ns_h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp['ns_h'];

    iso.AsString => [{"color":"red"},{"color":"blue"}]

--- 2

    str := '{ "ns_h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp['"ns_h"'];

    iso.AsString => ns_h

--- 3

    str := '{ "ns:h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp['"ns:h"'];

    iso.AsString => ns:h

--- 4

    str := '{ "ns:h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp['ns:h'];

    iso => nil

--- 5

    str := '{ "ns:h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp.AsObject['ns:h'];

    iso.AsString => [{"color":"red"},{"color":"blue"}]

--- 6

    str := '{ "ns:h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp.AsObject['"ns:h"'];

    iso => nil

--- 7

    str := '{ "ns:h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp['ns:h[0].color'];

    iso => nil

--- 8

    str := '{ "ns_h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp['ns_h[0].color'];

    iso.AsString => red

--- 9

    str := '{ "ns:h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp['ns\:h'];

    iso => nil

--- 10

    str := '{ "ns\:h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp['ns\:h'];

    iso => nil

--- 11

    str := '{ "ns\:h": [ { "color": "red" }, { "color": "blue" } ] }';
    resp := SO(str);
    iso := resp['ns:h'];

    iso => nil

Original issue reported on code.google.com by [email protected] on 8 Mar 2010 at 4:35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant