import coral
import sys

def printContent(lang, files=[]):

    list=[]
    contents=[]
   
    for filename in files:
        if filename[-3:]=="xml" or filename[-3:]=="xmi":
            project=coral.loadDocument(filename)
        else:
            continue
        for elem in project.contents():
            l=elem.__type__().__language__()                
            if l.getName() == "XMIDI":
                continue
            if l.getName() == lang[:-2]:
    
                if str(l.getVersion()) == lang[-2]:
                    if str(l.getRevision()) == lang[-1]:
                        for part in elem.__getAllParts__():
                            list.append(part)
                            
        contents.append(list)
        list=[]    
    return contents


