[messages] [Developers] Design of property and piece XML for V4

alitur juho.rutila at gmail.com
Thu Sep 13 12:29:07 MST 2012

I have to comment on the xml syntax. It isn't very ... xml-ish. As I
have developed xml consumers before I suggest to get it right from the
get-go. I have combined suggestions from previous posts and my own
points about the xml syntax to following:


<?xml version="1.0" encoding="UTF-8"?>
<gamebox xmlns="http://www.vassalengine.org/v4.xsd">
  <enum id="side">
  <template id="faces">
    <parameter id="FRONT"/>
    <parameter id="BACK"/>
    <parameter id="FULL"/>
    <parameter id="HALF"/>
        <property type="int" id="combat strength"
       <property type="int" id="combat strength">{HALF}</property>

  <piece id="Soviet army" abstract="true">
      <property type="int" default="8" id="FULL"/>
      <property type="int" default="4" id="HALF"/>
      <property type="string" id="name"/>
      <property type="enum" ref="side">SU</property>
      <property type="int" id="movement allowance">4</property>
      <use ref="faces">
         <parameter ref="FRONT"><propertyvalue ref="name"/>
<!-- or maybe better with something like -->
         <parameter ref="BACK">{name} back</parameter>
  <piece id="SU 1 Shock" extends="Soviet army">
    <property id="name">SU 1 Shock</property> <!-- This overrides
"Soviet Army" property "name" -->

I will list my notes here:

- xml declaration at the top
- Namespace (xmlns) should be defined. It keeps the format in shape and
xml validation is easy.
- Keep values inside elements and metadata (data about data) on
attributes (check the properties in my example)
- Property type should be an attribute. I do not want to write xml
parser that has to find all intproperties, stringproperties,
enumproperties etc. I just want to enumerate over properties.
- When you reference another element in the xml document, use ref="".
Inside a node I thnk {property-id} is sufficient placeholder.

Read this topic online here:

More information about the messages mailing list