JSON files

Hi all,

How can I parse JSON files? Something like XPath for JSON.

Cheers.

There are a few javascript based libraries that do something like xpath, I’m not sure if they could be used with Finalbuilder though as most of them depend on the existance of a browser window.

Edit : Actually I did manage to get this one working by fudging the window object :

http://jslinq.codeplex.com/

In the project global javascript, add this line :

var window = new Object();
Then in an action script event(javascript) this simple test worked for me :

[code]//USEUNIT C:\Users\Vincent\Downloads\JSLINQ_v2.10_SourcePlusExamples\scripts\JSLINQ.jsvar myList = [{FirstName:“Chris”,LastName:“Pearson”},{FirstName:“Kate”,LastName:“Johnson”},{FirstName:“Josh”,LastName:“Sutherland”},{FirstName:“John”,LastName:“Ronald”},{FirstName:“Steve”,LastName:“Pinkerton”}];var exampleArray = JSLINQ(myList).Where(function(item){ return item.FirstName == “Chris”; }).OrderBy(function(item) { return item.FirstName; });alert(exampleArray.items[0].LastName);[/code]

Note the UseUnit line needs to point to the path where the JSLINQ.js file lives on your machine.

HTH.