for (int i = 0; i < list.size(); i++) {    Element attrs = document.createElement(list.get(i));    tname.appendChild(attrs);   }这段代码第二行报错,我试过如果括号内改成(“name”)就可以log:Exception in thread "main" org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: 指定的 XML 字符无效或非法。 at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElement(Unknown Source)
                    
                    
                2 回答
                        已采纳
                    
                                        
                        
                            东风冷雪
                            
                                
                            
                        
                        
                                                
                    TA贡献33条经验 获得超7个赞
“name” 是字符串, attrs是Element对象,
改成 tname.appendChild(attrs.toString()); 试一下,看行不。。
添加回答
举报
0/150
	提交
		取消
	