|
Enable/disable ignoring of element-content whitespaces in source XML document |
|
|
By default, DOM reads entire data from source XML file. Besides elements,
attributes and comments it also processed character data like line-feeds
or new-line symbols. Sometimes such approach is inacceptable.
In order to ignore whitespaces around DOM-nodes DOM-factory should be
configured in the following way:
// create new factory is ordinary way:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
// this will make the parsers created by this factory must eliminate
// whitespace in element content:
factory.setIgnoringElementContentWhitespace(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.