[messages] [Developers] Design of property and piece XML for V4
juho.rutila at gmail.com
Fri Sep 14 02:18:01 MST 2012
> > Now the properties of the piece could be found under the properties
> > Property name would be the element name. The validation that
> > movement_allowance should be int could be defined in
> > battleformoscow.xsd. But is this only leading us to the next step?
> This prefents us from having a common schema for all modules. Creating
> a correct schema isn't easy, and having that will save us endless
> trouble from bad input. An incorrect schema means that we can't trust
> the integrity of the input we get. Few module designers will have ever
> heard of schmata, let alone be able to create ones which have no
Actually the common schema (vassal.xsd) would be common for all modules.
It only says that piece has to have some properties. That is common for
all the modules. The "extra" schema would be just for the game specific
properties. So instead of writing
<intProperty id="movement_allowance" minValue="0">5</intProperty>
where the property type and restrictions are in the tag, one could write
the metadata to a different file (game.xsd) and the actual value to
Okay, I have to admit the first one is easier to write. On the other
hand the latter xml file is easier to read and does not contain all the
metadata. The property definitions are also more reusable. Think of
writing many pieces with movement_allowance.
Also, are these files really written by hand? One can also write an xslt
that can do the transformation between those two formats.
Read this topic online here:
More information about the messages