By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,482 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,482 IT Pros & Developers. It's quick & easy.

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

P: n/a
kj

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?

TIA!

kynn

--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies

P: n/a
On Jun 20, 7:17 am, kj <so...@987jk.com.invalidwrote:
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.

Jun 27 '08 #2

P: n/a
kj
In <19**********************************@w8g2000prd.g ooglegroups.comJohn Machin <sj******@lexicon.netwrites:
>On Jun 20, 7:17 am, kj <so...@987jk.com.invalidwrote:
>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.
Hmmm!? OK. Thanks!

Kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.