

def testXMLValue(val, attrib=False):
    '\n\n    Test that the XML value exists, return val.text, else return None\n\n    Parameters\n    ----------\n\n    - val: the value to be tested\n\n    '
    if (val is not None):
        if attrib:
            return val.strip()
        elif val.text:
            return val.text.strip()
        else:
            return None
    else:
        return None

dataset/ETHPy150Open geopython/OWSLib/owslib/util.py testXMLValue/original