[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[xml-dev] XMI tools
- From: Pete Kirkham <pete@cafemosaic.co.uk>
- To: xml-dev <xml-dev@lists.xml.org>
- Date: Mon, 15 Oct 2001 21:56:23 +0100
Does anyone know of a decent tool support for mapping of
MOF model -> XMI Schema -> Java?
The XMI spec gives rules for generating DTDs from MOF, but these are not
strong enough to generate Java from, though if you make certain
assumptions about the way the latest UML DTD uses entities you can get
most of the way there automatically (the dtd uses entities to add
structure, so you can generate a schema by mapping entity names to
xs:complexType definitions then edit results by hand).
The way XMI is defined, there are multiple equivalent representations of
data, so most schema to java tools won't work; it assumes a level of
abstraction between data and implementation.
XMI specifies that attributes of MOF constructs can be represented as
either attributes of elements or sub elements, and where both are
present the subelement takes precedence, eg:
<ping pong="true"/>
<ping><ping.pong xmi.value="true"/></ping>
<ping pong="false"><ping.pong>< xmi.value="true"/></ping>
are all equivalent representations, and lists can be IDREFS attributes,
lists of references or objects:
<XMI.content>
<bucket name="bob" paints="z0 z1"/>
<paint id="z0" color="red"/>
<paint id="z1" color="blue"/>
</XMI.content>
<XMI.content>
<bucket name="bob">
<bucket.paints>
<paint xmi.idref="z0"/>
<paint xmi.idref="z1"/>
</bucket.paints>
</bucket>
<paint id="z0" color="red"/>
<paint id="z1" color="blue"/>
</XMI.content>
<XMI.content>
<bucket>
<bucket.name>bob</bucket.name>
<bucket.paints>
<paint color="red"/>
<paint>
<paint.color>blue</paint.color>
</paint>
</bucket.paints>
</bucket>
</XMI.content>
are equivalent representations of the same three objects.
It is required to parse all representations, but only one representation
needs to be generated
Pete.