def loadFromURL(self, url):
if isfile(url) is True:<EOL><INDENT>file = open(url, '<STR_LIT:r>')<EOL><DEDENT>else:<EOL><INDENT>file = urlopen(url)<EOL><DEDENT>try:     <EOL><INDENT>result = self.loadDocument(file)<EOL><DEDENT>except Exception as ex:<EOL><INDENT>file.close()<EOL>raise ParseError(('<STR_LIT>' %url,) + ex.args)<EOL><DEDENT>else:<EOL><INDENT>file.close()<EOL><DEDENT>return result<EOL>
Load an xml file from a URL and return a DOM document.