[XML-SIG] Converting XML Schema to data struture and then to XML

Stefan Behnel stefan_ml at behnel.de
Mon Mar 10 08:46:51 CET 2008


Hi,

Martin v. Löwis wrote:
>> BTW, from the POV of objectify, generating Python classes from a schema would
>> basically mean inferring a document instance from an XML Schema (sort of a
>> meta-model to model transformation). I find that an interesting relation, but
>> maybe that's just me...
> 
> It's just you. It would *not* be a meta-model to model transformation, 
> but a meta-model-to-meta-model one.

It obviously is a meta-to-meta model transformation to generate Python classes
from a schema, but "inferring a document instance from an XML Schema" is not.


> The schema defines a type system,
> just as a set of Python classes does. Instances of the schema (i.e.
> a document) then correspond to a set of instances of these classes.

Objectify doesn't generate code. Instead, it comes with an extensible
meta-model that resembles the basic Python type system, and which gets mapped
on a tree at runtime. So the act of inferring the classes from the schema is
actually linked to the instance, not the meta model. And the link is done
through validation, which assures that the document really is an instance. So
we end up with classes that represent an instance of a meta-model. There is no
intermediate step of a meta-to-meta model transformation.

Stefan


More information about the XML-SIG mailing list