|
Enable/disable ignoring comments |
|
|
Sometimes there is a need to ignore comment node in source XML file,
while producing DOM-document. This allows to avoid extra checking of
node types while browsing DOM-tree.
In order to ignore comments a corresponding property of DocumentBuilderFactory
object should be set to true. The following sample shows it:
// create new factory is ordinary way:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
// this will make the parsers produced by this factory will
// ignore comments; by default comment-nodes are processed to DOM-tree:
factory.setIgnoringComments(true);
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.