SGF & XML
- Hi there,
reading Jan's email I remembered that I got several similar emails
about XML in the past. It seems an XML DTD for board games is
I've put an early draft of SGFML onto my web site.
(Actually early means too-early-too-publish.)
Have a look at: http://www.red-bean.com/sgf/xml/
The DTD ist just there to describe the absolute essential stuff in
order to have valid SGFML example files. So don't turn away in
disgust. Everything is changeable :o)
I've uploaded two examples: a fairly standard server game and a
commented game from the GTL. Have a look.
The sharp eyed among you might note that the example files were
apparently created by SGFC - yes, I've added a quick and dirty
SGF2XML routine to SGFC. However, this is even more alpha than
the spec, so I don't publish it yet.
As the original author of the mail mr van der Steen posted here from the
computer-go mailing list, I am happy to see something is moving! :-)
I was about to write a sample draft DTD myself, but the one mr Hollosi has
posted is much better.
A first look at it brings up a question: Should the XML format mimic
the SGF one, or should it use the new possibilities? What I mean is that
a general "node" in SGF can correspond to several different in XML. The best
example would be the initial node describing the game information. Of course,
having a more or less exact match would make it possible to use both formats
with the same tree structure...
And a proposal for the name: 3 letter names are more useful as filename
extensions, so what about XGF? could mean eXtended Game Format, or eXtrasmart
Game Format... :-)
> From: vladdu@...I have uploaded SGFML version 0.02 at http://www.red-bean.com/sgf/xml/
> A first look at it brings up a question: Should the XML format mimic
> the SGF one, or should it use the new possibilities? What I mean is that
> a general "node" in SGF can correspond to several different in XML.
Changes from V0.01:
* changed many attributes from "CDATA" to more strict definitions
like "NMTOKEN", "ID", or "IDREF"
* changed <game> to have a <gameheader> instead of <header> to define
allowed elements within different headers
* created two node types: <node> and <setup>.
<setup> element from V0.01 was renamed to <addstone>
* added <gameinfo> element - gameinfo elements have to be stored within it
* added types to <source>: RECORD, COMMENT, FILE
* more sophisticated <date>: contains <dateitem> now in order to list
more than one date and periods of time
* renamed <people> to <person> - looks more natural
- Arno Hollossi wrote:
>I have uploaded SGFML version 0.02 at http://www.red-bean.com/sgf/xml/Hi! It looks a lot better!
I have one comment from my first look at the file.
<!ELEMENT sequence ( (node|setup)+, (sequence)* )>
<!-- two node types: nodes and setup nodes -->
This definition allows a node to have several moves, gameinfos, comments and
so on, which I suppose isn't wanted. Instead it might read something like:
<!ELEMENT node (move?, gameinfo?, markup*, line*, comment?, title?,
annotate?, value?, property) >
<!ELEMENT setup (title?, gameinfo?, addstone?, markup*, line*, comment?,
annotate?, value?, property?) >
This restrains the order of the elements, but I don't think it's a big
Get Your Private, Free Email at http://www.hotmail.com
- --- In sgf-std@y..., vladdu@... wrote:
> Hello!from the
> As the original author of the mail mr van der Steen posted here
> computer-go mailing list, I am happy to see something is moving! :-)
> I was about to write a sample draft DTD myself, but the one mr
> posted is much better.mimic
> A first look at it brings up a question: Should the XML format
> the SGF one, or should it use the new possibilities? What I meanis that
> a general "node" in SGF can correspond to several different inXML. The best
> example would be the initial node describing the game information.Of course,
> having a more or less exact match would make it possible to useboth formats
> with the same tree structure...filename
> And a proposal for the name: 3 letter names are more useful as
> extensions, so what about XGF? could mean eXtended Game Format, oreXtrasmart
> Game Format... :-)Is anyone doing anything on this front?
> Is anyone doing anything on this front?Many people have asked about an XML version. Over 2 years ago a group of
people set out to define such a file format (AFAIK up until now they only
have produced a requirements document).
I have dismissed XML until recently. Now, as I know core XML technologies by
heart (because of my job), I think it is a good idea. Also, now I have the
necessary knowledge of XML that I feel up to the task.
Actually, one week ago (independent of Vlad's email) I set out to start
define an XML format plus an API on top of the DOM. I don't want to present
my ideas prematurely, because I'd don't want to waste everyone's time with
Give me three more weeks and I will show you what I have got.
Btw, Vlad: I thought about naming it XGF just as you wrote your email ;o)
p.s. please disregard SGFML (currently on the web site), I didn't have a clue
about XML back then.
SL: http://senseis.xmp.net/ -- a pot of go at the end of the rainbow
GTL: http://gtl.jeudego.org/ -- have your own games reviewed
SGF: http://www.red-bean.com/sgf/ -- smart game file format