PrettyPrint not outputing anything !!
peter at engcorp.com
Thu Aug 15 03:35:16 CEST 2002
Fredrik Lundh wrote:
> Sunit Joshi wrote:
> > str = StringIO.StringIO()
> > PrettyPrint(sXml,str)
> > str.getvalue()
> > prints ''
> > Any ideas what might be wrong.
> I'm pretty sure PrettyPrint wants a parsed document, not a string.
> (from what I can tell, the function simply returns if the first argument
> doesn't have a "nodeType" attribute. that's not exactly helpful...)
But it's "prettier" than the exception traceback that would otherwise
be generated. Maybe they went overboard on the focus on "pretty". ;-)
More information about the Python-list