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

Julien Cassignol ainulindale at gmail.com
Fri Sep 14 07:36:24 MST 2012


Hey,

I already built such a thing (xsd), check previous messages. Your
implementation is not strongly typed:  property can be of both int and
string types, which doesn't seem simple to handle properly both in terms of
validation and in the engine.
On Sep 14, 2012 2:07 PM, "alitur" <juho.rutila at gmail.com> wrote:

>
> "uckelman" wrote:
> >
> > The extra schema is precisely what I'm objecting to. If it's
> > user-supplied, then we no longer have any assurance that it we're
> > getting valid data.
> >
>
> I actually managed to write an vassal.xsd file that demands the property
> tags to be for example integer type or string types (see attachment).
> So now the module writer cannot write the game.xsd wrong (and thus
> game.xml) and Vassal engine always knows that it will be getting string
> or integers from the properties tag. So, even though the module builder
> provides the schema, it still has to obey vassal.xsd.
>
>
> "uckelman" wrote:
> >
> >
> > "alitur" wrote:
> > >
> > > Also, are these files really written by hand?
> > >
> >
> > Some will be. And we will definitely spend some time examining them to
> > find module bugs, written by hand or not.
> >
>
> By writing the game files with schema in mind the file validates itself.
> I think xsd does not support for example validating following tag:
>
> Code:
>
> <intProperty name="movement_allowance" minValue="0">-5</intProperty>
>
>
>
> That line will break in the Vassal xml parser or even deeper (-5 < 0).
> If there would be schema behind properties, their validation would
> happen in the xml editor.
>
>
> "uckelman" wrote:
> >
> >
> > "alitur" wrote:
> > > One can also write an xslt that can do the transformation between
> > > those two formats.
> >
> > I can. But I don't expect that the average module designer can, nor to
> > I expect that the average module designer can write a correct schema.
> > (I don't expect that we're going to devise an editor which generates
> > schemata, either.) If we're setting up a system where the hard things
> > have to be done for each module by nonexperts rather than once by
> > experts, then we're setting up a system which is doomed to fail.
>
> My point here was that by providing the xslt (which does not have to be
> game specific, just common) vassal could provide and take in
> "human-friendly" xml and also "machine-friendly" xml+xsd. Although,
> don't know if this just messes things up more.
>
> _______________________________________________
> Read this topic online here:
> http://www.vassalengine.org/forum/viewtopic.php?p=36045#p36045
> _______________________________________________
> messages mailing list
> messages at vassalengine.org
> http://www.vassalengine.org/mailman/listinfo/messages
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vassalengine.org/pipermail/messages/attachments/20120914/fa0f083d/attachment-0001.html>


More information about the messages mailing list