// Does the current element belong to the list of elements
// that need to have some sort of space added?
if (element.getPrevious() instanceof Text) {
Text text = (Text) element.getPrevious();
WhiteSpaceFixStrategy strategy =
getWhiteSpaceFixStrategy(element, true);
int whitespaceCount = 0;
if (strategy != null &&
(whitespaceCount =
removeAndCountTrailingWhiteSpace(text)) > 0) {
for (int i=0; i<whitespaceCount; i++) {
strategy.fixUpSpace(element, true);
}
}
}
if (element.getNext() instanceof Text) {
Text text = (Text) element.getNext();
WhiteSpaceFixStrategy strategy =
getWhiteSpaceFixStrategy(element, false);
int whitespaceCount = 0;
if (strategy != null &&
(whitespaceCount =
removeAndCountLeadingWhiteSpace(text)) > 0) {
for (int i=0; i<whitespaceCount; i++) {
strategy.fixUpSpace(element, false);
}
}
}
// visit the children