def update_local_dataset_from_metadata(dataset_entity):
        
    # Reconstruct the name of the file
    folder = 'metadata'
    name = get_dataset_filename()
    working_folder = os.path.join(output_folder, folder)
    file_path = os.path.join(working_folder,name + '.xml')
    
    # Open the file and read in the xml
    metadata_file = open(file_path,'r')
    metadata_xml = et.parse(metadata_file)
    metadata_file.close()
    
    # Update the dataset title
    title = get_dataset_title()
    dataset_entity['title'] = title    

    # Get the abstract
    xpath_abstract = '//abstract'
    abstract_element = metadata_xml.find(xpath_abstract)
    if (abstract_element is not None):
        dataset_entity['notes'] = abstract_element.text
    else:
        logger.warn('Problem publishing dataset {0}. No abstract found in metadata.'.format(args.dataset_name))        

    # Get the maintainer
    xpath_maintainer= '//distinfo/distrib/cntinfo/cntorgp/cntorg'
    maintainer_element = metadata_xml.find(xpath_maintainer)
    if (maintainer_element != None):
        dataset_entity['maintainer'] = maintainer_element.text
    else:
        logger.warn('Problem publishing dataset {0}. No maintainer found in metadata.'.format(args.dataset_name))        

    # Get the maintainer email
    xpath_maintainer_email = '//distinfo/distrib/cntinfo/cntemail'
    maintainer_email_element = metadata_xml.find(xpath_maintainer_email)
    if (maintainer_email_element != None):
        dataset_entity['maintainer_email'] = maintainer_email_element.text
    else:
        logger.warn('Problem publishing dataset {0}. No maintainer email found in metadata.'.format(args.dataset_name))        

    # Get the author
    xpath_author = '//idinfo/citation/citeinfo/origin'
    author_element = metadata_xml.find(xpath_author)
    if (author_element != None):
        dataset_entity['author'] = author_element.text
    else:
        logger.warn('Problem publishing dataset {0}. No author found in metadata.'.format(args.dataset_name))        

    # Get the author_email
    dataset_entity['author_email'] = ''

    # Get the keywords
    keywords = []
   
    # If the dataset has existing tags, check for the 'featured'
    # tag and preserve it if it exists
    if ('tags' in dataset_entity):
        if ('featured' in dataset_entity['tags']):
            keywords.append('featured')
            logger.info('Preserving \'featured\' dataset tag');

    # Get the theme keywords from the ArcGIS Metadata
    xpath_theme_keys = '//themekey'
    theme_keyword_elements = metadata_xml.findall(xpath_theme_keys)
    
    # Get the place keywords from the ArcGIS Metadata
    xpath_place_keys = '//placekey'
    place_keyword_elements = metadata_xml.findall(xpath_place_keys)    
    
    # Combine the lists
    keyword_elements = theme_keyword_elements + place_keyword_elements
    
    for keyword_element in keyword_elements:
        keyword = slugify_string(keyword_element.text)
        keywords.append(keyword)
        logger.debug('Keywords found in metadata: ' + keyword);

    # Add the GIS keyword to all datasets published by this script
    keywords.append('gis')
    
    dataset_entity['tags'] = keywords

    return dataset_entity
Updates the CKAN dataset entity by reading in metadata
dataset/ETHPy150Open opencolorado/OpenColorado-Tools-and-Utilities/Scripts/ArcGIS/10.0/Python/PublishOpenDataset.py/update_local_dataset_from_metadata