validate dom tree object in python

Hi all:

I have to validate a dom tree but i canīt save it to a xml file.
I have been using the validating parser "xmlproc":
"
xml.parsers.xmlproc.xmlapp.DTDConsumer
xml.parsers.xmlproc.xmlapp.ErrorHandler
xml.parsers.xmlproc.xmlval
"
but i found that the function "create_input_source" in the following code 
that are placed in the module "xml.parsers.xmlproc.xmlapp": 
"
class InputSourceFactory:
    "A class that creates file-like objects from system identifiers."
    def create_input_source(self,sysid):
        if sysid[1:3]==":\\" or urlparse.urlparse(sysid)[0] == '':
            return open(sysid)
        else:
            return urllib2.urlopen(sysid)
"
donīt accept a instance of a xml dom tree.
I get the following error:
"
File "C:\Python23\Lib\site-packages\_xmlplus\parsers\xmlproc\xmlval.py", 
line 31, in parse_resource
self.parser.parse_resource(sysid)
File "C:\Python23\Lib\site-packages\_xmlplus\parsers\xmlproc\xmlutils.py", 
line 123, in parse_resource
infile = self.isf.create_input_source(sysID)
File "C:\Python23\Lib\site-packages\_xmlplus\parsers\xmlproc\xmlapp.py", 
line 224, in create_input_source
if sysid[1:3]==":\\" or urlparse.urlparse(sysid)[0] == '':
AttributeError: Document instance has no attribute '__getitem__'
"

My question is if exist a way of validate a xml dom tree object, not a xml 
file.
I accept any suggestions about other way of validate rather than "xmlproc".
I'm using python2.4

If this isn't the place to make this question please, if any know tell me 
where is

Thanks in advance

Received on Wednesday, 6 April 2005 16:56:36 UTC