简体   繁体   English

客户端上的XML到JavaScript哈希/数组

[英]XML to JavaScript hashes/arrays on the client

Any client js libraries for turning XML into a JavaScript object? 是否有任何用于将XML转换为JavaScript对象的客户端js库? I'm specifically working with RSS and ATOM XML. 我专门使用RSS和ATOM XML。

I don't want to go from XML to JSON then eval(). 我不想从XML转换为JSON,然后再转换eval()。

I'd like to go from XML directly to JavaScript hashes/arrays. 我想直接从XML转到JavaScript哈希/数组。

Try adobe's spry framework. 试试Adobe的spry框架。

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

they have a dataset object that does exactly this. 他们有一个数据对象完全可以做到这一点。

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

Lots of examples on how they turn xml into javascript datasets. 关于如何将xml转换为javascript数据集的许多示例。

http://labs.adobe.com/technologies/spry/samples/data_region/XMLDataSetStringHandlingSample.html http://labs.adobe.com/technologies/spry/samples/data_region/XMLDataSetStringHandlingSample.html

Have you looked at the Google AJAX Feed API ? 您是否看过Google AJAX Feed API

I use it all the time and you don't need to register for am API key anymore 我一直在使用它,您不再需要注册API密钥

You can use Yahoo Pipes if the source of the XML is an online feed somewhere. 如果XML的来源是某个地方的在线提要,则可以使用Yahoo Pipes。 This will gice you a JSON object that you can access like eg data[x].propertyName 这将为您提供一个可以访问的JSON对象,例如data [x] .propertyName

Using eval() isn't madatory for processing JSON ;) 使用eval()并不是处理JSON;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM