Omit the headers from XML message

kaklis at gmail.com kaklis at gmail.com
Fri May 28 12:38:23 EDT 2010


On 28 Μάϊος, 18:45, Jon Clements <jon... at googlemail.com> 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?
>
> > POST /test/pcp/Listener HTTP/1.1
> > User-Agent: Jakarta Commons-HttpClient/3.1
> > Host: 127.0.0.1:50002
> > Content-Length: 547
>
> > <pt_control_message xmlns="http://demo.com/demo">
> >   <cmdReply>
> >     <sessionList>
> >       <session>
> >         <id>scvdcvsdv</id>
> >         <subscriberId>sdfv</subscriberId>
> >         <subscriberName>Antonis Kaklis</subscriberName>
> >         <presence>away</presence>
> >         <note>testing the new client</note>
> >         <ipAddress>jlkdjf</ipAddress>
> >         <deviceClass>android</deviceClass>
> >       </session>
> >     </sessionList>
> >   </cmdReply>
> > </pt_control_message>
>
> Assuming the header is separated by a blank line, something like:
>
> list(islice(dropwhile(bool, s.split('\n')), 1, None))

Thank you!!!

Antonis



More information about the Python-list mailing list