Title: Message
I found something interesting...
 
the "stripWhitespaceText" setting only takes effect when "mergeAdjacentText" is also turned on.  mergeAdjacentText is false by default.
 
So, this works:
 
SAXReader xmlReader = new SAXReader();
xmlReader.setStripWhitespaceText(true);
xmlReader.setIgnoreComments(true);
xmlReader.setMergeAdjacentText(true);
doc = xmlReader.read(file);
 
Documents created like this can be successfully compared with NodeComparator:
 
 
NodeComparator compare = new NodeComparator();
int result = compare.compare(doc1, doc2);
return (result == 0);
 
 

Reply via email to