'Parse column definitions, which can either be a set of \'column\' elements
with a name and index (as in dynamic options config), or a shorthand
comma separated list of names in order as the text of a \'column_names\'
element.
A column named \'value\' is required.'

def parse_column_spec(self, config_element):

    self.columns = {}
    if (config_element.find('columns') is not None):
        column_names = util.xml_text(config_element.find('columns'))
        column_names = [n.strip() for n in column_names.split(',')]
        for (index, name) in enumerate(column_names):
            self.columns[name] = index
            self.largest_index = index
    else:
        self.largest_index = 0
        for column_elem in config_element.findall('column'):
            name = column_elem.get('name', None)
            assert (name is not None), "Required    'name'    attribute    missing    from    column    def"
            index = column_elem.get('index', None)
            assert (index is not None), "Required    'index'    attribute    missing    from    column    def"
            index = int(index)
            self.columns[name] = index
            if (index > self.largest_index):
                self.largest_index = index
            empty_field_value = column_elem.get('empty_field_value', None)
            if (empty_field_value is not None):
                self.empty_field_values[name] = empty_field_value
    assert ('value' in self.columns), "Required    'value'    column    missing    from    column    def"
    if ('name' not in self.columns):
        self.columns['name'] = self.columns['value']
