Changing data of xhtml document

Thanos Tsouanas thanos at sians.org
Sat Aug 13 20:12:36 EDT 2005


Hello list!

I've got a unicode string which holds an xhtml website, begining with
<!DOCTYPE ... and a functions which alters strings in a certain way.

I want to replace all actual data in this xhtml unicode string with the
function's output.  (By 'actual data' I mean anything that 

I thought I should use the XMLGenerator package, but first, I don't
like it's output, and second, it complaints about the <!DOCTYPE ...>
tag.  Also, it writes the <?xml ?> tag which I want to avoid at this
stage.

Are there any really easy solutions to this problem?
Any modules that could be helpful for slight modification of such
sgmlish files?  The downside of SGMLParser is that I have to override
all parser functions to actually leave everything intact instead of
doing nothing and override characters(data) to print the altered data.

Thanks in advance!

-- 
Thanos Tsouanas          .: My Music: http://www.thanostsouanas.com/
http://thanos.sians.org/ .: Sians Music: http://www.sians.org/



More information about the Python-list mailing list