Why no output from xml.dom.ext.PrettyPrint?

John Machin sjmachin at lexicon.net
Thu Jun 19 19:14:40 EDT 2008


On Jun 20, 7:17 am, kj <so... at 987jk.com.invalid> wrote:
> OK, the following should work but doesn't, and I can't figure out
> why:
>
> >>> from xml.marshal.generic import dumps
> >>> dumps( ( 1, 2.0, 'foo', [3,4,5] ) )
>
> '<?xml version="1.0"?><marshal><tuple><int>1</int><float>2.0</float><string>foo</string><list id="i2"><int>3</int><int>4</int><int>5</int></list></tuple></marshal>'
>
> >>> from xml.dom.ext import PrettyPrint
> >>> PrettyPrint( dumps( ( 1, 2.0, 'foo', [3,4,5] ) ) )
> >>> import sys
> >>> PrettyPrint( dumps( ( 1, 2.0, 'foo', [3,4,5] ) ), sys.stdout )
>
> Why am I seeing no output from PrettyPrint?
>

You need to ask whoever you got your xml package from. In standard-
issue Python 2.5.2, there is an xml package with xml.dom, but it
contains no xml.dom.ext nor an xml.marshal.




More information about the Python-list mailing list