Solved

expat example

Posted on 2006-07-16
8
1,978 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
Suggested Courses

622 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