'Check the fields configuration in the stylesheet (if any)'

def __inspect(self):

    ALL = 'ALL'
    ANY = 'ANY'
    tree = self.tree
    ns = {'s3': 'http://eden.sahanafoundation.org/wiki/S3'}
    elements = tree.xpath('./s3:fields', namespaces=ns)
    select = {}
    skip = {}
    for element in elements:
        tables = element.get('tables', ANY).split(',')
        fields = element.get('select', None)
        if ((fields is not None) and (fields != ALL)):
            fields = set([f.strip() for f in fields.split(',')])
        exclude = element.get('exclude', None)
        if (exclude is not None):
            exclude = set([f.strip() for f in exclude.split(',')])
        for table in tables:
            tablename = table.strip()
            if fields:
                select[tablename] = (None if (fields == ALL) else fields)
            if exclude:
                skip[tablename] = exclude
    self.select = select
    self.skip = skip
    return
