1
我收到XML格式如下。删除XML(Javascript)中标记之间的不需要的空格
<rec>
<id> servicedescription </id>
<name> Description Value </name>
<type> textbox </type>
</rec>
但这不起作用,因为我的系统不接受标签之间存在的空间。我需要如下东西
<rec>
<id>servicedescription</id>
<name>Description Value</name>
<type>textbox</type>
</rec>
请大家帮我介绍一下Javascript。非常感谢
PS:非常抱歉,如果这个问题以前曾被问过。我搜索了很多,但没有得到信息。
你如何处理这个XML在JavaScript? –
我收到一个具有XML的DOM对象。我将它序列化为String格式,将其转换为JSON并进行处理。 – StackAddict
检查此问题http://stackoverflow.com/questions/20346243/how-do-i-remove-unwanted-spaces-from-exported-xml-data-being-loaded-into-javascr?rq=1 – Naren