コード例 #1
0
 /**
  * Helper function to remove indentations.
  *
  * @param element
  * @param removables
  */
 private void removeIndentations(OMElement element, List<OMText> removables) {
   Iterator children = element.getChildren();
   while (children.hasNext()) {
     Object next = children.next();
     if (next instanceof OMText) {
       OMText text = (OMText) next;
       if (text.getText().trim().equals("")) {
         removables.add(text);
       }
     } else if (next instanceof OMElement) {
       removeIndentations((OMElement) next, removables);
     }
   }
 }