views:

98

answers:

3

Any client js libraries for turning XML into a JavaScript object? I'm specifically working with RSS and ATOM XML.

I don't want to go from XML to JSON then eval().

I'd like to go from XML directly to JavaScript hashes/arrays.

+1  A: 

Try adobe's spry framework.

http://labs.adobe.com/technologies/spry/

they have a dataset object that does exactly this.

http://labs.adobe.com/technologies/spry/samples/

Lots of examples on how they turn xml into javascript datasets.

http://labs.adobe.com/technologies/spry/samples/data%5Fregion/XMLDataSetStringHandlingSample.html

Zoidberg
+1 thanks I'll have to look at this. Been years since I looked at this framework.
tyndall
A: 

Have you looked at the Google AJAX Feed API?

I use it all the time and you don't need to register for am API key anymore

fudgey
A: 

You can use Yahoo Pipes if the source of the XML is an online feed somewhere. This will gice you a JSON object that you can access like e.g. data[x].propertyName

Using eval() isn't madatory for processing JSON ;)

danwellman
I know eval() isn't mandatory (just helpful). Very helpful if you consider all the browsers haven't implemented a native safe way to process JSON. I think that is coming soon, but I couldn't find any good links on it.
tyndall
What I really want is something that loops over the XML DOM and produces a array/hashtable object and skips the JSON representation.
tyndall