removing ignorable whitespace from minidom.DOM

Discussion in 'Python' started by haughki, Oct 8, 2003.

  1. haughki

    haughki Guest

    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
     
    haughki, Oct 8, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manuel Collado
    Replies:
    0
    Views:
    430
    Manuel Collado
    Jun 18, 2004
  2. Replies:
    0
    Views:
    366
  3. Replies:
    3
    Views:
    552
    Stefan Behnel
    Aug 3, 2007
  4. Mayeul
    Replies:
    0
    Views:
    1,003
    Mayeul
    Jul 11, 2011
  5. Joe Kesselman
    Replies:
    2
    Views:
    908
    Joe Kesselman
    Jul 12, 2011
Loading...

Share This Page