PrettyPrint not outputing anything !!
Peter Hansen
peter at engcorp.com
Wed Aug 14 21:35:16 EDT 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". ;-)
-Peter
More information about the Python-list
mailing list