#!/usr/bin/env python
import re
import sys

emptyElementRegExp = re.compile("<([^>]+)>(?:\\s|<!--.*-->)*</\\1>", re.DOTALL)

for fileName in sys.argv[1:]:
	try:
		file = open(fileName, 'r')
		matches = emptyElementRegExp.findall(file.read())
		if len(matches) > 0:
			print "The file '" + fileName + "' contains the following empty elements:"
			print str(matches)
			print "Please remove these, they will break the translation process."
	except IOError, e:
		print e

