🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4013

Re: how to create XMLDocument from text string

#4013
From: Hans Galema
Date: Wed, 27 Apr 2005 07:11
26 lines
1976 bytes
Daniel Stevenson wrote:
> I'm using BCB6, i have an application with a TServerSocket, I am being sent
> XML to my socket and I am struggling to turn the text string into a valid
> XML document using TXMLDocument.

Could you please explain what has to be done/added before the xml that you
received is considered valid xml ?


> void __fastcall TMyService::SocketRead(TObject *Sender,
>       TCustomWinSocket *Socket)
> {
>   AnsiString RxBuffer = Socket->ReceiveText();
> 
>   TXMLDocument *XML = new TXMLDocument("");

That is very unreliable code to begin with. Who guarantees
that RxBuffer contains all the data sent by the client ?
This approch will only go right when the client only now
and then sends small pieces of data (<10K or so ).

> What is the correct method of attempting to import text into an XMLDocument?

With that I have no experience.

Hans.
Technical Details
Message-ID: <426f3bd3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newscon02.news.prodigy.com!prodigy.net!newshosting.com!nx02.iad01.newshosting.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <426f30b1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,202e5b119b206323
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 27 Apr 2005 09:11:47 +0200
From: Hans Galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: how to create XMLDocument from text string
References: <426f30b1@newsgroups.borland.com>
In-Reply-To: <426f30b1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <426f3bd3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1114586067 129.125.201.248 (27 Apr 2005 00:14:27 -0700)
Lines: 26
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newscon02.news.prodigy.com!prodigy.net!newshosting.com!nx02.iad01.newshosting.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail