Graham Dumpleton
grahamd at dscpl.com.au
Mon May 16 19:49:58 EDT 2005
The path "../common/tstmt.dtd" is not a valid URL. Exactly what the error message says. The urllib2 module be expecting an address of the form "http://hostname/some/path". You might try something like "file:///some/path/common/tstmt.dtd". Where "/some/path/common/tstmt.dtd" is the full path to the file as it exists on your machine. Not sure if urllib2 will accept that though. You might also find that if you simply have an absolute path rather than a relative pathname, ie., "/some/path/common/tstmt.dtd", the code might be smart enough to realise it is a local file and just grab it from the file system rather than invoking urllib to get it. I am guessing here as I am not familar with the package being used. For about the fourth time, a general question like this would be better posted on: http://groups-beta.google.com/groups?group=comp.lang.python&hl=en You will have a better chance of finding people there who would know the answer to your question. tushar liladhar patil wrote .. > I have this attached file downloaded from site:http://pythonforge.technomagic.net/modules.php?name=News&file=article&sid=8 > I have installed > xml.dom.ext.reader import Sax2 > HTMLgen > as per the requirment of python file. > > but when i run the code > as python filename.py it will flag an error like: > [anand at inetcomp pythonPoint]$ python important.py > > Creating New Testament > Traceback (most recent call last): > File "important.py", line 284, in ? > main() > File "important.py", line 274, in main > CreateReport("nt.xml") > File "important.py", line 267, in CreateReport > Dom = LoadDOM(filename) > File "important.py", line 30, in LoadDOM > doc = reader.fromStream(f) > File "/usr/lib/python2.3/site-packages/_xmlplus/dom/ext/reader/Sax2.py", > line 372, in fromStream > self.parser.parse(s) > File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", > line 109, in parse > xmlreader.IncrementalParser.parse(self, source) > File "/usr/lib/python2.3/site-packages/_xmlplus/sax/xmlreader.py", line > 123, in parse > self.feed(buffer) > File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", > line 216, in feed > self._parser.Parse(data, isFinal) > File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", > line 395, in external_entity_ref > self._source.getSystemId() or > File "/usr/lib/python2.3/site-packages/_xmlplus/sax/saxutils.py", line > 523, in prepare_input_source > f = urllib2.urlopen(source.getSystemId()) > File "/usr/lib/python2.3/urllib2.py", line 129, in urlopen > return _opener.open(url, data) > File "/usr/lib/python2.3/urllib2.py", line 324, in open > type_ = req.get_type() > File "/usr/lib/python2.3/urllib2.py", line 226, in get_type > raise ValueError, "unknown url type: %s" % self.__original > ValueError: unknown url type: ../common/tstmt.dtd > [anand at inetcomp pythonPoint]$ > > please help me it's urgent .....plz...plz... Everything with you is urgent. > if anything left mail me i will send info. Yes, send mailing address to everyone on the list so we can all send an invoice to you for our time in answering all these questions you keep asking which have nothing to do with the topic of the mod_python mailing list. I note you are now also sending them to reportlab list when they are also nothing specific to it either. Urgent that you send this so we can bill you and get our money as soon as possible. :-) :-) :-) :-) Note that in general most people would have no problem helping you with your problems, but the fact that the questions are off topic and that everytime you say it is urgent, gets a bit annoying after a while. :-(
|