aboutsummaryrefslogtreecommitdiff
path: root/src/test/xmlwritetest/xmlwritetest.cpp
blob: 2986c35081e35835e2793d932d11f4f8d4ddd702 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "xmlfilewriter.h"
#include "xmlstringwriter.h"

void fillItIn( XmlWriter &w )
{
	w.addNode("thinglist");
	
	w.addNode("thing");
	w.addProperty("type", "Weapon");
	
	w.addNode("id", "Klophin Staff", true );
	w.addNode("name", "Klophin Staff", true );
	w.addNode("durability", "0.01", true );
	w.addNode("size", "0.1", true );

	w.addNode("config");
	w.addNode("damage", "3d6+4", true );
	w.addNode("class", "melee", true );
	w.addNode("type", "bludgeon", true );
	w.addNode("damagedesc", "club/clubs", true );
	w.closeNode();

	w.closeNode();

	w.closeNode();
}

int main()
{
	printf("Testing XmlWriter...\n");
	//XmlFileWriter wf("test.xml", "\t");

	//fillItIn( wf );

	//XmlStringWriter ws("\t");
	//fillItIn( ws );

	//printf("Now the string version:\n\n%s\n", ws.getString().c_str() );

	return 0;
}