def getNamespaces(self): # this is needed because we don't know the namespaces registered # with the exported. These are dynamic and depend on the extensions # which are using the exporter. This function is an attempt at # dynamically inserting the namespaces, and hopefully gets the # order correct. nss = [] for prefix, uri in sorted(registry.getNamespaces(True)): nss.append('xmlns:%s="%s"' % (prefix, uri)) return ' '.join(nss)