Re: [xml] How to add datatypes



On Thu, Oct 21, 2010 at 6:01 PM, samaram s  wrote:
Thank you so much.
int Val = 10;

If Val is int, you need to transform it into a string. Check the
documentation of itoa and sprintf.

But when i tried as you said, it says 2nd argument should be xmlchar* type
not char* . when i type casted it, it doesn't like it.
Also for xmlNewProp(node, BAD_CAST "Token",Val);

The following worked for me:
xmlNewDocComment(doc, BAD_CAST buffer);
xmlNewProp(node, BAD_CAST "Token", BAD_CAST buffer);

-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]