[XML-SIG] Validation from Python code?

David Goodger dgoodger@bigfoot.com
Sun, 29 Jul 2001 12:59:16 -0400


In the Docstring Processing System, there is a class library module [1]_
with one class for each element in the DTDs [2]_. The nodes (text & element
objects) have an asdom() method, which constructs an xml.dom.minidom tree. I
would like to implement a validate() method, which would verify that the
content of each element node adheres to the content models from the DTDs. I
could manually code each validate() method, but thought that there must be
some way to encode the content models in the classes such that they can be
automatically validated (without running an external parser). Basically I'm
looking for the XML/DOM equivalent of regular expression matching, something
that can answer the question: "given a pattern P, is DOM tree D valid?"

Does anybody know of ways to accomplish this validation? Pointers to
existing standards and/or implementations would be much appreciated. Any
Python implementations out there?

Thanks in advance.

David Goodger

.. _[1] http://docstring.sourceforge.net/dps/nodes.py

.. _[2] http://docstring.sourceforge.net/spec/gpdi.dtd,
   http://docstring.sourceforge.net/spec/ppdi.dtd,
   http://docstring.sourceforge.net/spec/soextblx.dtd

-- 
David Goodger    dgoodger@bigfoot.com    Open-source projects:
 - Python Docstring Processing System: http://docstring.sourceforge.net
 - reStructuredText: http://structuredtext.sourceforge.net
 - The Go Tools Project: http://gotools.sourceforge.net