Leticia Larrosa <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]
http://www.doxdesk.com/

--
Andrew Clover
mailto:[EMAIL PROTECTED]
http://www.doxdesk.com/
_______________________________________________
XML-SIG maillist  -  XML-SIG@python.org
http://mail.python.org/mailman/listinfo/xml-sig

Reply via email to