for (int i = 0; i < list.size(); i++) {????Element attrs = document.createElement(list.get(i));????tname.appendChild(attrs);???}這段代碼第二行報(bào)錯(cuò),我試過(guò)如果括號(hào)內(nèi)改成(“name”)就可以log:Exception in thread "main" org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: 指定的 XML 字符無(wú)效或非法。?at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElement(Unknown Source)
2 回答
已采納

東風(fēng)冷雪
TA貢獻(xiàn)33條經(jīng)驗(yàn) 獲得超7個(gè)贊
“name”? 是字符串, attrs是Element對(duì)象,
改成? ? tname.appendChild(attrs.toString()); 試一下,看行不。。
添加回答
舉報(bào)
0/150
提交
取消