GENERATING ADDITIONAL COMMENTS TO THE INSTANCE DOCUMENT:
Additional comments can be added by the following method.
XBRLProcessor xbrlProc = ...;
...
List commentList = new ArrayList();
commentList.add("1st comment");
commentList.add("2nd comment");
xbrlProc.setProperty(XBRLProperties.COMMENTS, commentList);
REMOVING EXISTING COMMENTS
There are no methods to remove existing comments, but the comments can be removed by the following procedure.
1. Output the instance document as DOM.
DOMResult result = new DOMResult();
xbrlProc.saveInstance(instance, result);
2. Remove the existing comments from the DOM.
org.w3c.dom.Document doc = (org.w3c.dom.Document)result.getNode();
... Remove comment nodes ...
3. Save the DOM to the file
javax.xml.transform.Transformer transformer = ...;
transformer.transform(new DOMSource(doc), new StreamResult("instance.xbrl"));
Author: Neal Wang
Attachment: