XML versus Plain text
XML versus Plain text
What is the advantage of using XML to store config etc vs plaintext considering overhead, etc. I heard its pointless to use XML for small things.
XML is really more of an object-oriented aproach. Seeing as its a database it is somewhat pointless for small things that you could use other means of tracking, but others might disagree. It doesn't really matter in the end what database system you choose (XML, Plaintext, etc), as long as it writes and loads variables.
in contrast to INI files or other plain text-
arrays and hierarchy are trivial,
it formats special characters so you don't need to worry about quotes etc,
it's readable by man and machine,
and it's the modern way to do things.
the main advantage for just using it to store a couple of simple values is that you don't have to write and test your own load and save code, so it's potentially quicker to write.
arrays and hierarchy are trivial,
it formats special characters so you don't need to worry about quotes etc,
it's readable by man and machine,
and it's the modern way to do things.
the main advantage for just using it to store a couple of simple values is that you don't have to write and test your own load and save code, so it's potentially quicker to write.
On a personal level, I despise XML. I use INI formats for all my configs, you can find tons of free INI parsers around. It is however, convenient to use XML since irrXML is included in Irrlicht.
My reasons for hating XML is because of the way people have tried to overuse the technology over the past 5-6 years. People want to use it for everything...XML formatted network messages, realtime XML logging( I know, realtime and XML shouldn't be included in the same sentence ), the list goes on. And generally, use of XML for config files is gross over-use. As was mentioned by someone in this thread, XML is useful for defining heirarchy in text format, but aside from that, bleh, pointless IMO.
My reasons for hating XML is because of the way people have tried to overuse the technology over the past 5-6 years. People want to use it for everything...XML formatted network messages, realtime XML logging( I know, realtime and XML shouldn't be included in the same sentence ), the list goes on. And generally, use of XML for config files is gross over-use. As was mentioned by someone in this thread, XML is useful for defining heirarchy in text format, but aside from that, bleh, pointless IMO.
-
- Posts: 56
- Joined: Thu Oct 12, 2006 5:15 am
I use in my item system...
CGameItem test = new CGameItem("elixir.xml",2003);
obs: 2003 = item serial =/
Code: Select all
<?xml version="1.0"?>
<!-- Item System by Gladius Coldhead-->
<name name="Elixir Medicinal" />
<description description="Elixir usado para curar ferimentos e recuperar Vida" />
<id id="7" />
<!-- Weight in KG , float-->
<height Weight="1.3" />
<!-- use 'type list' -->
<type type="1034" />
<!-- model & texture in char* -->
<model model="itemmodels/elixir.obj" />
<texture texture="itemtextures/elixir.jpg" />
<triggerregion triggerregion="10" />
<value value="20" />
obs: 2003 = item serial =/
Hi,
Hmmm. I think this way is better IMO. You can store multiple item data in one file.Gladius_Coldhead wrote:I use in my item system...
CGameItem test = new CGameItem("elixir.xml",2003);
obs: 2003 = item serial =/
Code: Select all
<?xml version="1.0"?>
<!-- Item System by Gladius Coldhead-->
<items_list>
<item name="Elixir Medicinal" id="7" type="1034">
<description>
Elixir usado para curar ferimentos e recuperar Vida
</description>
<!-- Weight in KG , float-->
<height value="1.3" />
<!-- use 'type list' -->
<type value="1034" />
<!-- model & texture in char* -->
<model value="itemmodels/elixir.obj" />
<texture value="itemtextures/elixir.jpg" />
<triggerregion value="10" />
<value value="20" />
</item>
.
.
.
</items_list>