def build_schema(m, c_c):
    '''
    Build an xsd schema from a bridgepoint component.
    '''
    schema = ET.Element('xs:schema')
    schema.set('xmlns:xs', 'http://www.w3.org/2001/XMLSchema')

    global_filter = lambda selected: ooaofooa.is_global(selected)
    for s_dt in m.select_many('S_DT', global_filter):
        datatype = build_type(s_dt)
        if datatype is not None:
            schema.append(datatype)
    
    scope_filter = lambda selected: ooaofooa.is_contained_in(selected, c_c)
    for s_dt in m.select_many('S_DT', scope_filter):
        datatype = build_type(s_dt)
        if datatype is not None:
            schema.append(datatype)
            
    component = build_component(m, c_c)
    schema.append(component)
    
    return schema
Build an xsd schema from a bridgepoint component.