def split_params(s):
    """Turn foo,bar=baz into {'foo': None, 'bar': 'baz'}
    """

    xsl_params = {}
    for param in s.split(','):
        tokens = [t.strip() for t in param.split('=')]
        xsl_params[tokens[0]] = len(tokens) > 1 and tokens[1] or None
    return xsl_params