Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert Json string into Object(s) or Cursor(s)
Message
From
15/05/2020 01:04:21
 
 
To
14/05/2020 19:34:57
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
01674427
Message ID:
01674433
Views:
122
Hi Antonio. Thank you for your help.

You're right about the commas. It's because I had to reduce the real response from the WS so that it wasn't too long for showing it as the example, the trailing commas were left inadvertedly.

I downloaded your JsonToXML library set but when I try to use the JsonToXML class it cannot be instantiated, then I discovered that it has a reference to a "namer.prg" file which wasn't included in the library's Zip file I downloaded from gitHub.

On the other hand, could you tell me which of the nfJson functions did you use? Because I tried with the nfJsonToCursor() function and it didn't work, then, I tried with nfOpenJson() and I could accommodate it to get just the parent records.

TIA


Could you tell me which of the nfJson functions did you use? Because I tried with the nfJsonToCursor() function and it didn't work, then I tried with nfOpenJson() and I could accommodate it to get just the parent records.

TIA

>Luis,
>
>I checked with nfJson and in fact it's complaining about some trailing commas at the end of some object members. If they are removed from the JSON object, then nfJson tools are able to process the object. I'm sure Marco will have a look into this.
>
>Meanwhile, I tried my JsonToXML class and found out it can process the JSON as you're receiving from your provider. A crude cursor can be created from the XML, if you do not want to inspect / process the XML object directly.
>
>
>m.jx = CREATEOBJECT("JsonToXML")
>m.xml = m.jx.Convert("luis-guerra.json")
>? XMLTOCURSOR(STRCONV(m.xml.selectNodes("//array").item(0).xml, 11))
>
>
>Browse as attached.
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform