Sign up Calendar Latest Topics

  Author   Comment  

Posts: 6
Reply with quote  #1 
Foreword: this post will be a bit "techical", oriented mainly to software developers.

I was looking at some mission files and I've noticed that their XML is very heavily attribute-oriented.
This it not necessary a bad thing but it's a consolidated best-practice for XML documents to use elements for the "actual" object's data and attributes for the object's metadata (see and

For example, something like
<create count="30" type="nebulas" nebType="1" startX="88169.0" startY="0.0" startZ="44203.0" endX="88169.0" endY="0.0" endZ="44203.0" randomRange="11324" />

could be written as

A lot of programmers would argue about the excessive verbosity of this second version, but in my opinion something readable but verbose is better than something compact but illegible.

An element-centred XML scheme is also simpler to use in an object-oriented programming language: classes can be easily mapped to and from this type of XML.
In the example above, both <start> and <end> tags can be mapped to the same "Position" class with three properties: "x", "y" and "z".

I'll end my ramblings with the definition of XML:
In computing, Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both  human-readable and machine-readable.
Mike Substelny

Avatar / Picture

Posts: 2,061
Reply with quote  #2 
I see your point. This format would make mission scripts a bit larger and lot longer. Of course you would only notice it in an XML text editor - - - in any sort of programming environment it would be invisible.

For those wanting to learn the raw XML coding it would make the learning process somewhat easier and the coding more foolproof.

"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Previous Topic | Next Topic

Quick Navigation:

Easily create a Forum Website with Website Toolbox.