[英]How to parse and obtain a div element with a particular class using the SAX Parser
[英]How to remove an element using SAX parser
感謝您之前的回復,
我是使用Java解析概念的新手,誰能指導我如何使用saxparser修改xml。 我搜索了很長時間以刪除標簽,但我不知道如何刪除。 請引導我
您可以使用以下方法刪除元素:
SAXReader reader = new SAXReader();
reader.setEncoding(CharEncoding.UTF_8);
Document customXmlDocument = reader.read(inputStream);
// Get the element you want to remove and then pass it to the remove method as so
customXmlDocument.remove(Element)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.