开发者

Uncomment XML using Java (DOM)

开发者 https://www.devze.com 2022-12-19 18:24 出处:网络
I\'m trying to access an XML file using DOM.One node is already commented out.How do I uncomment it using java code开发者_如何转开发?A comment is a special node in DOM. See the Comment class. A commen

I'm trying to access an XML file using DOM. One node is already commented out. How do I uncomment it using java code开发者_如何转开发?


A comment is a special node in DOM. See the Comment class. A comment could indeed contain anything, including wrongly formatted code. So there is not such thing as toggle comment/uncomment in DOM, even if that's what we are used to do as developper.

So to uncomment, I guess you will need to remove the node, and create a regular DOM node that correspond to your need. You may need to parse the comment content returned by Comment#getData().

0

精彩评论

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

关注公众号