Omit the headers from XML message

Peter Otten __peter__ at web.de
Fri May 28 12:48:27 EDT 2010


Jon Clements wrote:

> On 28 May, 16:24, "kak... at gmail.com" <kak... at gmail.com> wrote:
>> Hi i have the following xml message i want to omit the headers, any
>> hints?

> Assuming the header is separated by a blank line, something like:
> 
> list(islice(dropwhile(bool, s.split('\n')), 1, None))

Making the same assumptions, but giving a single string instead of a list of 
lines:

s.partition("\n\n")[-1]

Peter



More information about the Python-list mailing list