Create an xml from an object [duplicate]
Possible Duplicate:
c++ linux library for creating an xml and reading from an xml (serialize/ deserialize)
HI, I am working in Ubuntu. I would like to create an xml from am object I have t开发者_运维技巧his:
Class me
{
std::tring name;
int age;
};
main()
me *p = new me();
p->age=12;
p->name="dina";
How can I create an xml. I would like to have
<data>
<name>p->name</name>
<age>p->age</age>
</data>
You should look at TinyXml; it allows a Document Object Model (DOM) to be constructed with your object attributes and then saved to file.
精彩评论