python xml common dtd path

Exenunuby

New Member
I'm writing a python script which parses a XML file. To validate xml I'm using dtd file, but this XML file is using tag \[code\]SYSTEM = "dtdrules.dtd"\[/code\]. Now after more than 100 XMLs are generated by different user as input file to python. After all users copy this dtd file to their own directory, I now realised that there should be one common dtd file to be kept in some path and all the instance of my script should use this. But if I change the dtd file path in python script, all user has to do to modify there xml to use this path in SYSTEM tag. Is there any way so that I can modify python xml parser (without modifying XMLs) to take dtd file from one single path?Library used: xml.dom ans xml.parsers
Python version: Python 2.7.3
 
Back
Top