使用 Javascript 将 XML 转换为 JSON(并返回) [英] Convert XML to JSON (and back) using Javascript

查看:41
本文介绍了使用 Javascript 将 XML 转换为 JSON(并返回)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您将如何从 XML 转换为 JSON,然后再转换回 XML?

How would you convert from XML to JSON and then back to XML?

以下工具运行良好,但并不完全一致:

The following tools work quite well, but aren't completely consistent:

有没有人遇到过这种情况?

Has anyone encountered this situation before?

推荐答案

我认为这是最好的:XML 和 JSON 之间的转换

请务必阅读 xml.com O'Reilly 站点上的随附文章,其中详细介绍了这些转换的问题,我认为您会从中得到启发.O'Reilly 主持这篇文章的事实应该表明 Stefan 的解决方案是有价值的.

Be sure to read the accompanying article on the xml.com O'Reilly site, which goes into details of the problems with these conversions, which I think you will find enlightening. The fact that O'Reilly is hosting the article should indicate that Stefan's solution has merit.

这篇关于使用 Javascript 将 XML 转换为 JSON(并返回)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆