开发者

How to remove an element using SAX parser

Thanks for previous replies,

I am new to parsing concept using java, can anyone guide me how to modify the xml using saxparser. i searched long t开发者_如何学Goime to delete the tag but i dont know how to delete. pls guide me


You can remove an element using this :

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜