Previous Table of Contents Next


2.4 XML-based Model Interchange

   The XML-based Model Interchange (XMI) Format standard [XMI98] defines a set of mappings from the MOF modeling concepts to a representation in XML (eXtensible Markup Language), a standard of the World Wide Web Consortium (W3C) [XML98].

   XML was chosen for its growing popularity for data expression, and for the flexibility provided by its type definition system. The XML is essentially a tree-based language consisting of a series of nested “elements,? each of which is represented by a set of matching start and end tags. These elements may also include a number of name-value pairs called attributes, which appear within the opening tag of the element. The flexibility of the language lies in the ability to associate an XML document with a Document Type Definition (DTD). This DTD allows for the placement of further specific restrictions on the contents of an element. These include restrictions on the type of data (for example, numbers, strings with/without white space) allowable between two tags. The element can also be restricted in terms of the attributes that may appear within the element, and on the types of their value. Further, a restriction can be placed on the different elements (and the number of each) that are allowable beneath an element on the document tree.

   The XMI specification provides two main components: a set of rules for producing a DTD from a model, and a set of rules for the transfer of data between XMI and a MOF-compliant repository. Each instance of a MOF Package, Class, or Association is represented by an XML element. In addition, every instance of a MOF Class contains an XMI identifier in the form of an attribute labelled “xmi.id? on the instance’s XML element. When a class instance appears by reference (rather in the form of a full declaration), it is referenced by an “xmi.idref? attribute in the XML element. MOF Attributes whose types are simple types are represented as elements containing data, except for enumerations and booleans, whose values are enclosed in attributes, within self-closing tags. Attributes whose values are class instances are represented either as class instance declarations or as references to class instances using the scheme mentioned above.

   1. The type system for MOF Attributes is currently the subject of revision within the MOF RTF and may change during the lifetime of this document.