[XML-SIG] validate dom tree object

Andrew Clover and-xml at doxdesk.com
Thu Apr 7 19:56:16 CEST 2005

Leticia Larrosa <LETICIA at tesla.cujae.edu.cu> wrote:

> i found that the function "create_input_source" in the following code 
> that are placed in the module "xml.parsers.xmlproc.xmlapp": 

>     "A class that creates file-like objects from system identifiers."

> don't accept a instance of a xml dom tree.

That's correct. A DOM tree is not a system identifier (effectively, a URI).

> My question is if exist a way of validate a xml dom tree object, not a xml 
> file.

Not currently as far as I know. For reasons of tradition, validation is 
typically done at parse-time.

There is no standard way in the W3C DOM interface to retain the 
information from <!ELEMENT ...> and <!ATTLIST ...> declarations in the 
DTD, so most Python implementations do not keep this information, which 
is needed to do validation.

(My own imp pxdom does keep the information, in a non-standard extended 
interface. So it would be possible to create a DOM-based validator based 
on this... it's something I'm considering doing myself, but not a 
priority at the moment.)

Andrew Clover
mailto:and at doxdesk.com

Andrew Clover
mailto:and at doxdesk.com

More information about the XML-SIG mailing list