public static DefinitionList eliminateEmptyStructures ( DefinitionList dl ) { ContentElement dt = dl . getDefinedTerm ( ) ; if ( dt != null && dt . empty ( ) ) dl . setDefinedTerm ( null ) ; for ( int i = dl . nrOfDefinitions ( ) - 1 ; i >= 0 ; i -- ) { ContentElement ce = dl . getDefinition ( i ) ; if ( ce . empty ( ) ) dl . removeDefinition ( ce ) ; } return dl ; }
Removes all empty Structures from a DefinitionList and all substructures .