0

I've been provided with a json file to show results in a tableview. But when I tried json file validation using online json file editor then I am getting "Build tree failed" error.

I posted this message to my client about wrong json file and then he has posted some strange description which I am totally unaware.

Yes the json is not a pure json. It has javascript variables which have json variable. For now u can use a webview to evaluate the javascript variables and use the json value. For ex : dp_f : corresponds to list of departure train is a javascript array variable. U may have to eval the variable and store each array element is a new json with key as dp_f and value of array of these values

Please tell me how can I use this json file which is not pure. What is the way to parse such files ?

1
  • we'll need to see the json file to help Commented Dec 27, 2012 at 5:30

1 Answer 1

1

The only real way to evaluate JavaScript (which is really what you have, not JSON) is to evaluate JavaScript.

You will have to use some form of eval(). I recommend trying a JavaScript sandbox, if available to you. Of course the best option would be to get the data fixed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.