[XML-SIG] an example of generating XML?

Thomas B. Passin tpassin@comcast.net
Tue, 10 Sep 2002 08:19:08 -0400


[Matt Gushee]

> On Tue, Sep 10, 2002 at 01:02:26AM -0400, Thomas B. Passin wrote:
>
> > Here is a minimal example that works, though without error handling.
>
> Almost works, you mean?
>

Yes, I accidentally left off an import statement.

> > from xml.dom import Document
> > from xml.dom.ext.Printer import PrintWalker,PrintVisitor
> >
> > EMPTY_NAMESPACE=None
> >
> > def build_doc():
> >     dt = implementation.createDocumentType('','','')
>
> implementation?
>

It is defined in dom\__init__.py (as illustrated in test_document.py).  And
the code runs as expected on my system, when the import statement isn not
cut out.  Although, as I actually look at that part of __init__.py, I see
that it really likes to set implementation to

HTMLDOMImplementation.HTMLDOMImplementation()

if it can, otherwise to

DOMImplementation.DOMImplementation()

Cheers,

Tom P