'IgnoringElementContentWhitespace is not deleting all text nodes with a clean space, but only node nodes whose parents are described in the scheme with the contents of ELEMENT, that is, they contain only other elements and never texts.
If you do not have the schema used (DTD or XSD), the content of the element defaults to MIXED, so this parameter will never have any effect. (If the analyzer does not provide a non-standard DOM extension for processing all unknown elements containing ELEMENT content, which, as far as I know, are available for Java, no.)
You can hack a document along the way to the parser to include information about the schema, for example by adding an internal subset to <! DOCTYPE ... [...]> containing <! ELEMENT ...>, then use the IgnoringElementContentWhitespace parameter.
Or perhaps simpler, you can simply remove the space nodes either in the post process or when using LSParserFilter.
bobince
source share