import coral
import sys

S = coral.loadDocument(sys.argv[1])

assert S.contents().size() == 1

language = S.contents()[0]

print "import coral"
print
print "language = coral.Language.__getLanguageByXMLNS__(\"" + str(language.URInamespace) + "\")"
print 
for i in language.elements:
    print str(i.name) + " = language.getElement(\"" + str(i.name) + "\")"
