Solved

expat example

Posted on 2006-07-16
8
1,973 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

830 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