Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert Json string into Object(s) or Cursor(s)
Message
De
15/05/2020 01:04:21
 
 
À
14/05/2020 19:34:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Divers
Thread ID:
01674427
Message ID:
01674433
Vues:
117
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.
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform