@classmethod
def fromXmlString(ownclass, string, context, template=None):
    """Loads the array from a comma-separated string.
        
        Note: this is not actually used in XML values files, because array elements are stored in individual
        XML elements through the load/save methods. However, this method is used by scripts that take data
        values from strings (command line arguments, environmental variables). Hence its existence, but the
        name is far from perfect...
        """
    strings = string.split(',')
    if template is not None and template.hasAttribute('shape'):
        shape = template.getAttribute('shape').split(',')
        assert len(shape
            ) == 1, 'Cannot assign values to arrays with more than 1 dimension through a comma-separated string.'
        if shape[0] != ':':
            n = int(shape[0])
            if len(strings) < n:
                strings += [None] * (n - len(strings))
            strings = strings[:n]
    data = []
    for item in strings:
        if item == '':
            item = None
        elif item is not None:
            item = ownclass.elementclass.fromXmlString(item, context, template)
        data.append(item)
    return ownclass(data, template=template)
