def parse_1_0_elements(element, depth=0):
    result = ''
    result += get_indented(depth, element.attributes['name'].value)
    complex_types = get_children_by_tag_name(element, 'xsd:complexType')
    if len(complex_types) > 0:
        print(complex_types)
        complex_type = complex_types[0]
        for attribute_node in get_children_by_tag_name(complex_type, 'xsd:attribute'):
            attribute_node_name = attribute_node.attributes['name'].value
            attribute_node_type = attribute_node.attributes['type'].value
            attribute_node_use = attribute_node.attributes['use'].value if attribute_node.attributes.has_key('use') else None
            result += get_indented(depth + 1, '- attr: %s (%s) %s' % (attribute_node_name, attribute_node_type, attribute_node_use))
        sequences = get_children_by_tag_name(complex_type, 'xsd:sequence')
        if len(sequences) > 0:
            sequence = sequences[0]
            for sub_element in get_children_by_tag_name(sequence, 'xsd:element'):
                result += parse_1_0_elements(sub_element, depth=depth+1)
    return result
dataset/ETHPy150Open tkrajina/gpxpy/xsd/pretty_print_schemas.py/parse_1_0_elements/original