From: kaklis on
On 2 Éïýí, 03:47, John Machin <sjmac...(a)lexicon.net> wrote:
> On Jun 2, 1:57 am, "kak...(a)gmail.com" <kak...(a)gmail.com> wrote:
>
>
>
>
>
> > On Jun 1, 11:12 am, "kak...(a)gmail.com" <kak...(a)gmail.com> wrote:
>
> > > On Jun 1, 11:09 am, John Bokma <j...(a)castleamber.com> wrote:
>
> > > > "kak...(a)gmail.com" <kak...(a)gmail.com> writes:
> > > > > On Jun 1, 10:34 am, Stefan Behnel <stefan...(a)behnel.de> wrote:
> > > > >> kak...(a)gmail.com, 01.06.2010 16:00:
>
> > > > >> > how can i fix it, how to "ignore" the headers and parse only
> > > > >> > the XML?
>
> > > > >> Consider reading the answers you got in the last thread that you opened
> > > > >> with exactly this question.
>
> > > > >> Stefan
>
> > > > > That's exactly, what i did but something seems to not working with the
> > > > > solutions i had, when i changed my implementation from pure Python's
> > > > > sockets to twisted library!
> > > > > That's the reason i have created a new post!
> > > > > Any ideas why this happened?
>
> > > > As I already explained: if you send your headers as well to any XML
> > > > parser it will choke on those, because the headers are /not/ valid /
> > > > well-formed XML. The solution is to remove the headers from your
> > > > data. As I explained before: headers are followed by one empty
> > > > line. Just remove lines up and until including the empty line, and pass
> > > > the data to any XML parser.
>
> > > > --
> > > > John Bokma                                                               j3b
>
> > > > Hacking & Hiking in Mexico -  http://johnbokma.com/http://castleamber.com/-Perl&Python Development
>
> > > Thank you so much i'll try it!
> > > Antonis
>
> > Dear John can you provide me a simple working solution?
> > I don't seem to get it
>
> You're not wrong. Trysomething like this:
>
> rubbish1, rubbish2, xml = your_guff.partition('\n\n')

Ok thanks a lot!
Antonis