+ def findNamespaceByModule(String module) {
+ var namespace = moduleNameToUri.get(module)
+ if (namespace === null) {
+ val moduleSchemas = schemas.modules.filter[it|it.name.equals(module)]
+ var latestModule = moduleSchemas.head
+ for (m : moduleSchemas) {
+ if (m.revision.after(latestModule.revision)) {
+ latestModule = m
+ }
+ }
+ if(latestModule === null) return null
+ namespace = latestModule.namespace
+ uriToModuleName.put(namespace, latestModule.name)
+ }
+ return namespace
+ }
+