Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Putting float/int values in xml document

206221Apr 24 2002
I am using Oracles XML Parser for C (ver 9i). I have a float or int value which i want to put in the xml document that I am creating. The part of the code is as below..


char str_l[50];
float height_l;
....
....

elem_l = createElement(ctx_i, (oratext *)"HEIGHT");
if (!appendChild(ctx, parent_l, elem_l))
{
printf("Error Creating Element\n");
return FAILURE;
}


parent_l = elem_l;

height_l = 15.7;
sprintf(str_l, "%f", height_l);

elem_l = createTextNode(ctx_i, str_l);

if (!appendChild(ctx, parent_l, elem_l) )
{
printf("Error Creating Element\n");
return FAILURE;
}


This put 0.00000 as the value of height in the document. ie the o/p is

<HEIGHT>0.00000</HEIGHT>


Can anyone help me out with this.

Thanks and regards
Umesh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 22 2002
Added on Apr 24 2002
0 comments
219 views