最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to convert XML(SOAP) to JSON object by JavaScript - Stack Overflow

programmeradmin0浏览0评论

is this possible to send cross site request by AJAX with a SOAP request and get XML response? and i want to convert my xml response to json format is there any framework (like mustache) to do this easily

is this possible to send cross site request by AJAX with a SOAP request and get XML response? and i want to convert my xml response to json format is there any framework (like mustache) to do this easily

Share Improve this question edited May 4, 2013 at 2:41 hippietrail 17k21 gold badges109 silver badges179 bronze badges asked Jul 26, 2011 at 4:39 GauravSTomarGauravSTomar 6141 gold badge7 silver badges26 bronze badges 4
  • Do you have access to the server? – Joe Commented Jul 26, 2011 at 4:44
  • i also want to know how to send soap request to a sever by javascript – GauravSTomar Commented Jul 26, 2011 at 4:48
  • XML can represent just about anything with attributes, namespaces, and values. Where JSON generally represents a structure, which is a list of strings, integers, doubles, dates, arrays, and the like. An example of the XML would be required in order to know what JSON could possibly represent it. Can any random XML be represented by JSON? I suppose if it were straight string values, ignoring all attributes, perhaps. – Brain2000 Commented Jul 26, 2011 at 4:57
  • @Brain2000 Actually, depending on how you defined it, JSON can represent arbitrary set of XML, but it is bloated and unweildy. – cwallenpoole Commented Jul 26, 2011 at 5:59
Add a ment  | 

1 Answer 1

Reset to default 1

You can make use of xml2js node library. It converts xml to json and vice versa. But it doesn't uses templates. https://www.npmjs./package/xml2js

发布评论

评论列表(0)

  1. 暂无评论