Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
下面我尝试寻找元素并在其上附加一个孩子;但是它有什么问题!!??
// Document doc; Element cust = doc.createElement("cust"); cust.appendChild(doc.createTextNode("anyname")); org.w3c.dom.Node custmers = doc.getElementsByTagName("custmers").item(0); custmers.appendChild(cust);
如果您想避免导航到特定元素,请尝试使用 xpath。
关联