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