How to read and write XML files and treat the comment nodes as text nodes in Java when saving
问题 I'm reading an XML file in Java retrieved from an external system, then processing it and eventually save it locally and deploy it back. The external system gives me an XML file that contains this node: <customApplications> <label><!-- GDPR Management --></label> <name>GDPR_Management</name> </customApplications> The problem is the comment node. When I read the file and then just save it, the result looks like this: <customApplications> <label> <!-- GDPR Management --> </label> <name>GDPR