removing ignorable whitespace from minidom.DOM

H

haughki

apologies for asking this. it must have been answered before. i have
really tried to find the answer elsewhere.

a simple question: i'd like to remove all ignorable whitespace from
my minidom representation. it make the DOM much cleaner (for me).

i've resorted to parsing first with Sax2 and using StripXml to deal
with the whitespace. why not stick with the Sax2 DOM you ask? legacy
code all uses the minidom, and they're not *quite* compatible.

unfortunately, the Sax2 parser moves all of my (very intentional)
namespace declarations to the document level, which causes me yet
another headache). if anyone here happens to know how to *stop* the
Sax2 reader from mucking up my namespaces, that would be nice to know
too. of course, i'm sure the mucking is done for another Very
Important Reason. it's still mucking to me.

in a better world, i'd vow my lifelong service to anyone who can help
with these questions. in ours, i'll say: thanks in advance ; )

haughki
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top