[XML-SIG] PyXML documentation (was [mgushee@havenrock.com: Re: [FRPythoneers] xml woes])

Mike Olson Mike.Olson@fourthought.com
06 Sep 2002 13:14:11 -0600


> > 
> >    from xml.dom.ext.Printer import PrintWalker, PrintVisitor
> > 
> >    f = open('foo.xml','w')
> >    v = PrintVisitor(f, 'iso8859-1', indent='  ')
> >    w = PrintWalker(v, document)
> >    w.run()
> >    f.close()
> > 
> > Works for me.

As a note, you don't need to do that much work
Just
xml.dom.ext.Print(node)
will get it to print to a string, or
xml.dom.ext.Print(node,open('foo.xml','w'))
will print to the file.
If you want Pretty, same call signatures to
xml.dom.ext.PrettyPrint

> 
> You know, it occurs to me that this isn't documented *anywhere* (at
> least I couldn't find any docs last time I forgot how to do it).
> Shouldn't it be? What's the proper way to submit an addition to the
> PyXML documentation?

But now you can always reference the FrPythoneers mailing list, we just
need to tell the rest of the world :)

Actully, contact Fred Drake as he is incharge of the PyXML docs.

Mike

> 
> -- 
> Matt Gushee
> Englewood, Colorado, USA
> mgushee@havenrock.com
> http://www.havenrock.com/
> 
> _______________________________________________
> XML-SIG maillist  -  XML-SIG@python.org
> http://mail.python.org/mailman/listinfo/xml-sig
-- 
Mike Olson                                Principal Consultant
mike.olson@fourthought.com                +1 303 583 9900 x 102
Fourthought, Inc.                         http://Fourthought.com 
PO Box 270590,                            http://4Suite.org
Louisville, CO 80027-5009, USA
XML strategy, XML tools, knowledge management