Solved

expat example

Posted on 2006-07-16
8
1,968 Views
Last Modified: 2012-06-21
Expat example....here is the code...
http://sysu817200.tripod.com/
-------------------------------------
Here are the error messages...
----------------------------------------
the error logs are in output.txt

Pleas help me fix run time errors...
Rgds,
0
Comment
Question by:sudarshantk
8 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 17119783
Hi sudarshantk,
Please post your runtime errors, and show the assoicated line of code the errors refer to.

Cheers!
0
 

Author Comment

by:sudarshantk
ID: 17119794
I am able to parse the xml file correctly..but when i store the values into internal structures it gives following errors..
-----------------------------------------------------------------------------------------------------

IP=192.168.1.1
PRESENT=1
HEARTBEAT TYPE=1
HEARTBEAT PERIOD=0
PERIODIC PERIOD=60
PERIODIC TOGGLE=1
PERIODIC VALUE=¨—ÿ¿®‚xi
PERIODIC VALUE=111111111111111111111oggle="true">loseheartbea
PERIODIC VALUE=¨—ÿ¿®‚x1
PERIODIC VALUE=</periodic>1111111111oggle="true">l
PERIODIC VALUE=¨—ÿ¿®‚xd
PERIODIC VALUE=<ondemand>>1111111111oggle="true">l
ONDEMAND TOGGLE=0
ONDEMAND VALUE=¨—ÿ¿®‚xn
ONDEMAND VALUE=0000000000000000000001ggle="true">l
ONDEMAND VALUE=¨—ÿ¿®‚x0
ONDEMAND VALUE=0000000000000000000002ggle="true">l
ONDEMAND VALUE=¨—ÿ¿®‚x0
ONDEMAND VALUE=0000000000000000000003ggle="true">l
ONDEMAND VALUE=¨—ÿ¿®‚x0
ONDEMAND VALUE=</ondemand>00000000003ggle="true">l
ONDEMAND VALUE=¨—ÿ¿®‚xa
ONDEMAND VALUE=</tags>a
ONDEMAND VALUE=¨—ÿ¿®‚xa
ONDEMAND VALUE=</ip>‚xa
IP=192.168.1.2
PRESENT=0
HEARTBEAT TYPE=0
HEARTBEAT PERIOD=0
PERIODIC PERIOD=0
PERIODIC TOGGLE=0
ONDEMAND TOGGLE=0
ONDEMAND VALUE=¨—ÿ¿®‚xa
ONDEMAND VALUE=<ipval="192.168.1.2"present="false"></ip>rtbea
IP=192.168.1.3
PRESENT=1
HEARTBEAT TYPE=0
HEARTBEAT PERIOD=200
PERIODIC PERIOD=60
PERIODIC TOGGLE=0
PERIODIC VALUE=¨—ÿ¿®‚xi
PERIODIC VALUE=311111111111111111111rese
PERIODIC VALUE=¨—ÿ¿®‚x1
PERIODIC VALUE=</periodic>1111111111rese
PERIODIC VALUE=¨—ÿ¿®‚xd
PERIODIC VALUE=<ondemandtoggle="false">e
ONDEMAND TOGGLE=0
ONDEMAND VALUE=¨—ÿ¿®‚xn
ONDEMAND VALUE=3000000000000000000001">e
ONDEMAND VALUE=¨—ÿ¿®‚x0
ONDEMAND VALUE=3000000000000000000002">e
ONDEMAND VALUE=¨—ÿ¿®‚x0
ONDEMAND VALUE=3000000000000000000003">e
ONDEMAND VALUE=¨—ÿ¿®‚x0
ONDEMAND VALUE=</ondemand>00000000003">e
ONDEMAND VALUE=¨—ÿ¿®‚xa
ONDEMAND VALUE=</tags>a
ONDEMAND VALUE=¨—ÿ¿®‚xa
ONDEMAND VALUE=</ip>‚xa
----------------------------------------------------
0
 

Author Comment

by:sudarshantk
ID: 17119802
line of code that prints the above is
232-243 line.c
0
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
LVL 8

Accepted Solution

by:
manish_regmi earned 125 total points
ID: 17119929
1) your reader.txt contains invalid xml. I have already spotted the errors in your prevoius question. please replace it with new one i posed.

2)
<ondemand  toggle=”false”>
                       3000000000000000000001
                       3000000000000000000002
                       3000000000000000000003
</ondemand>

If these are three seperate values put them in seperate tag. If they are single value don't use newline.

<ondemand  toggle=”false”>
                       3000000000000000000001
 </ondemand>
<ondemand  toggle=”false”>
                       3000000000000000000002
 </ondemand>
<ondemand  toggle=”false”>
                       3000000000000000000003
 </ondemand>

regards
Manish Regmi
0
 
LVL 8

Expert Comment

by:manish_regmi
ID: 17119958
also in char_hndl(),

you may not have got whole value

shouldn't it  be

for(l=0; l < txtlen; l++)

regards
Manish Regmi
0
 
LVL 14

Assisted Solution

by:cwwkie
cwwkie earned 125 total points
ID: 17121279
>> If these are three seperate values put them in seperate tag. If they are single value don't use newline.

Or use a contruct like this:

<ondemand  toggle=”false”>
                       <data>3000000000000000000001</data>
                       <data>3000000000000000000002</data>
                       <data>3000000000000000000003</data>
</ondemand>
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question