Putting float/int values in xml document
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