是否可以将xml写入json对象? [英] Is it possible to write xml into json object?
本文介绍了是否可以将xml写入json对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在javascript中遇到问题,将包含xml字符串的var放入对象中,然后使用jQuery通过ajax发送.
I'm having issues in javascript with putting a var that contains xml string into a object and then send it via ajax with jQuery.
问题将是:是否可以在json对象中包含xml字符串?
The question would be: is it possible to have a xml string into a json object ?
{"a":"a","b":"b", "xml":"<test r='r'></test>"}
预先感谢
推荐答案
您的XML将如下所示:
Your XML will be like this:
< test r="r"> </test>
替换如下:
& = &
" = "
' = '
< = <
> = >
/ = /
这篇关于是否可以将xml写入json对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文