Solved

expat example

Posted on 2006-07-16
8
1,962 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now