[XML-SIG] XML Binding?

Daniel Dittmar dittmar@snafu.de
Fri, 21 Jun 2002 00:57:26 +0200


Bill la Forge wrote:
> Now the real question is, who would be interested in working on such a
> project?

I have something similar. It can currently  generate Python classes and 
C code for expat.

The Python classes are probably quite straight forward:
- each <!ELEMENT  ...> gets it's own class
- attributes become instance variables, initialized to the default value
- def set_attributename () is generated for each attribute
- sub elements become also instance variables, initialized to None
- def add_subelementname () is generated
- list elements <!ELEMENT List (ListItem*)> are generated as subclasses 
of UserList
- customization is done by subclassing these classes and using a factory 
with these subclasses during the parse

The C/expat version generates a parser which calls setter methods on 
independently defined classes, which seems also the way Quick works 
(after one very quick look into the XML Binding book)

I'm going to put the code, docs and some examples on the web so that you 
can see if it would be along your line.

By the way, I named it FOM for Fixed Object Model (this would make DOM 
the Dynamic Object Model).

Daniel