pleasssssssssssssssssssssse?

hi I need one explain to me this c++ code it clinte code send query to server as xml and reseve responce as xml the point that not clear to me how extracting data
******************************************
#include <windows.h>
#include <winsock.h>
#include <iostream>

using namespace std;

#pragma comment(lib, "wsock32.lib")

int main()
{

WORD version;
WSADATA wsaData;
int rVal=0, x=0, i, n=1;

char* env;
env = new char[5000];
char* data;
data = new char[5000];
char buf[500000]="",input[20]="";
FILE *out;
FILE *in;

for(i=0;i<(int)strlen(buf);i++)
buf[i]='\0';
for(i=0;i<5000;i++)
env[i]='\0';
for(i=0;i<5000;i++)
data[i]='\0';




strcpy(buf,"<?xml version='1.0'?><soap:Envelope xmlns:soap='http://www.w3.org/2001/12/soap-envelope'><soap:Body><Request><Query>LogOn</Query><UserName>");
cout<<"User name: ";
cin>>input;
strcat(buf,input);
strcat(buf,"</UserName><Password>");
cout<<"Password: ";
cin>>input;
strcat(buf,input);
strcat(buf,"</Password><Language>");
cout<<"Language: ";
cin>>input;
strcat(buf,input);
strcat(buf,"</Language><ConnectionSpeed>");
cout<<"ConnectionSpeed (High/Low): ";
cin>>input;
strcat(buf,input);
strcat(buf,"</ConnectionSpeed></Request></soap:Body></soap:Envelope>");



rVal = send(theSocket, buf, (int)strlen(buf), 0);
if(rVal == SOCKET_ERROR)
{
//sError("Failed send()");
cout<<"Socket error: Failed send."<<endl;
WSACleanup();
return CS_ERROR;
break;
}

for(i=0;i<500000;i++)
buf[i]='\0';

rVal = recv(theSocket, buf, 500000, 0);

strtok(buf,">");
x=0;
//------------ Loop for extracting soap data---------------
while ((env = strtok(NULL,">"))!= NULL)
{
if (int(env[0]) != int('<'))
{
i=0;
while ((int(env[i]) != int('<'))&& ( env[i] != NULL ))
{
data[x]=env[i];
i++;
x++;
}
data[x]='\n';
x++;
}
}
//--------------------------
data[x]=NULL;
cout<<endl<<"Response: "<<data<<endl<<endl;
}//end if
}//end while

closesocket(theSocket);
cout << "closing client"<< endl;}

}
[2838 byte] By [fofa4ever] at [2007-12-5 11:57:46]
# 1 Re: pleasssssssssssssssssssssse?
No.

chem
chemicalNova at 2007-12-5 14:47:16 >
# 2 Re: pleasssssssssssssssssssssse?
Its just manually looping throught the XML breaking out any values and storing them into an array.
wossname at 2007-12-5 14:48:16 >
# 3 Re: pleasssssssssssssssssssssse?
Does it not burn your eyes looking at it slapped there like that?! I cbf reading through it.

chem
chemicalNova at 2007-12-5 14:49:15 >
# 4 Re: pleasssssssssssssssssssssse?
No.

Anyway you should look into eXpat. Which is a really nice XML library (open source) for *nix/windows.
wossname at 2007-12-5 14:50:19 >