Re: Reading XML stream using unmanaged c++



It is never safe to assume values are char *, or that they have a fixed upper bound.
Generally you have to keep reading until you have a complete input by whatever definition
you mean by "complete input". In the case of a Web server, you should be looking for the
language type and encoding (e.g., UTF8) as well.

I have used the ExPat library to handle XML; the MSXML stuff is rather complex and if I
recall it is DOM-oriented, which is a really poor design.
joe

On Thu, 16 Nov 2006 16:03:26 +0530, "Mayur" <mayur@xxxxxxxxxxxxxxxx> wrote:

Hello All,

My code below sending request to web server and getting response as XML
string.
char* response;
wf.getResponse(response,500);

where outout of above function returns xml string which is stored in
response variable.

response ="<login>
<session_id>50e39f252f247cc8e4ebb40416f16c38</session_id>
<logged_in>TRUE</logged_in>
<voice_enabled>TRUE</voice_enabled>
<ads_disabled>TRUE</ads_disabled>
<user_id>97558</user_id>
-
- <buddy_list>
<user_id>97002</user_id>
<username>unicorn11</username>
<logged_in>FALSE</logged_in>
<game_id>0</game_id>
<user_id>97562</user_id>
<username>yashwant</username>
<logged_in>FALSE</logged_in>
<game_id>0</game_id>
</buddy_list>
<auto_join_channel />
<button_config />
</login>";

I need to parse this string so that i can check output where user is logged
in whats game ID and all these parameter i required to manuoulate
my task.

where i implemeneted this in c# using XmlTextReader which is so simple but i
need it in unmanaged c++ application..


so please help me regarding this....
wating for reply.
Mayur

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.


Loading