[XML-SIG] value error when parsing XML

Ajay Brar abra9823 at mail.usyd.edu.au
Tue Aug 3 12:42:32 CEST 2004

Mike Brown wrote:

>Ajay Brar wrote:
>>i get a value error when parsing an xml file. This is because it can't 
>>find the DTD -
>>ValueError: unknown url type: ../um_xml/um.dtd
>> From what i have discovered in the archives, this happens when your XML 
>>and DTD file are not in your current directory
>>i have the directory structure
>>      user - this is where i am running the script from
>>      um_xml- this is where the xml and dtd are
>>can someone please tell me how i can workaround this problem. the script 
>>executes fine when the xml and dtd files are in user/. But i don't 
>>really want to put them there.
>>any ideas?
>The "current directory" / "where you are running the script from"
>has no bearing on the interpretation of URLs in the document (not
>directly, anyway).
>If both files are in the same location, you only need to refer to the
>DTD via the URL um.dtd (no add'l path info prepended to it).
I have no additional path info prepended to the um.dtd
my xml file goes - <?xml version='1.0' encoding='utf-8'?><!DOCTYPE um 
SYSTEM 'um.dtd'>.....
like i said, earlier the dtd and the xml are in the same directory.
the script that parses it is in a different directory. it all works fine 
if the dtd is in the same directory as the parsing script, but otherwise 
i get the Value Error.


Ajay Brar
CS Honours 2004
Smart Internet Technology Research Group


More information about the Python-list mailing list