InaSAFE Disaster risk assessment tool developed by AusAid - metadata module.
Contact : email@example.com
New in version 3.2.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
insert an XML element in an other creating the needed parents. :param root: The container :type root: ElementTree.Element :param element_path: The path relative to root :type element_path: str :return: ElementTree.Element :rtype : ElementTree.Element
merge two dictionaries.
if both have a same key, the one from extra_dict is taken
a merge of the two dictionaries
returns prettified XML without blank lines
based on http://stackoverflow.com/questions/14479656/ :param xml_str: the XML to be prettified :type xml_str: str :return: the prettified XML :rtype: str
Get the text from an XML property.
Whitespaces, tabs and new lines are trimmed
the text of the element at the given path
context manager to be used when reading metadata so no errors are risen.
This is useful because we want to be able to get as much as possible out of malformed input
|Parameters:||metadata (BaseMetadata) – the metadata object|