如何生成XML的文件,在VS2005 c++的环境下。
需要配置什么信息,最好有个例子代码。将一个数组信息添加到一个新建的xml文件中去,我是一个菜鸟,希望能讲的详细一些,谢谢。
[解决办法]
看看这个:
http://blog.csdn.net/sdl2005lyx/article/details/6634072
[解决办法]
用tinyxml吧,下载下来有例子的,可能编译不通过,把编译不通过的地方直接注释就行
{
FILE* textfile = fopen( "test5.xml", "w" );
if ( textfile )
{
fputs("<?xml version='1.0'?><a.elem xmi.version='2.0'/>", textfile);
fclose(textfile);
TiXmlDocument doc;
doc.LoadFile( "test5.xml" );
XmlTest( "dot in element attributes and names", doc.Error(), 0);
}
}
{
FILE* textfile = fopen( "test6.xml", "w" );
if ( textfile )
{
fputs("<element><Name>1.1 Start easy ignore fin thickness
</Name></element>", textfile );
fclose(textfile);
TiXmlDocument doc;
bool result = doc.LoadFile( "test6.xml" );
XmlTest( "Entity with one digit.", result, true );
TiXmlText* text = doc.FirstChildElement()->FirstChildElement()->FirstChild()->ToText();
XmlTest( "Entity with one digit.",
text->Value(), "1.1 Start easy ignore fin thickness\n" );
}
}