Can some one shed some light on the difference between XML and XMI? Can XMI be used in place of XML?
3 Answers
The XML Metadata Interchange (XMI) is an Object Management Group (OMG) standard for exchanging metadata information via Extensible Markup Language (XML).
XMI integrates four industry standards:
XML - eXtensible Markup Language, a W3C standard. UML - Unified Modeling Language, an OMG modeling standard. MOF - Meta Object Facility, an OMG language for specifying metamodels. MOF Mapping to XMI
http://en.wikipedia.org/wiki/XML_Metadata_Interchange
So XMI is a specific application of XML.

- 178,213
- 47
- 333
- 501
-
can XMI be used in place of XML? That was my question. – zengr Apr 09 '10 at 04:57
-
6And the question just lies within there. If XMI is an application of XML, you cannot use it instead of XML. XMI has a strict purpose, XML is a way of defining markup languages. It's like asking if you can interchange bricks and a house to do the same thing. – Dominik Honnef Apr 09 '10 at 05:01
-
XML is used as a part of XMI, so if you're using XMI then you're using XML. – alirobe Apr 09 '10 at 05:01
-
so, that means, when I am required to deliver an XML file, if my code created a file called filename.xmi, I am correct? – zengr Apr 09 '10 at 05:07
-
2@zengr: All XMI files are XML, but not all XML files are XMI. – Robert Harvey Apr 09 '10 at 05:09
-
Hi @RobertHarvey!I have a question:As you mentioned `not all XML files are XMI` then what it is? – user2019510 Aug 12 '13 at 22:53
-
@user2019510 See my answer below. – Robert Harvey Aug 12 '13 at 23:02
OK, let's try this again.
No, you cannot use XMI in place of XML. XMI is a specific use of XML.
XMI can only be used to exchange metadata information in accordance with the OMG standard. XMI is a specific application of XML. XMI can only be used for XMI purposes. XML, on the other hand, can be used for all XML applications, including XMI.

- 178,213
- 47
- 333
- 501
-
1
-
1Well, I already answered the question once. Satisfactorily, I thought. – Robert Harvey Apr 09 '10 at 05:11
-
-
3you don't quite seem to understand that XML itself is meaningless. one uses XML to build his own markup, by providing rules like XMI did. XMI *IS* XML, just as sharks are fish. That does, however, not mean, that every fish functions as a shark. If you want to "convert" XMI to XML, just don't touch the file and you are done. – Dominik Honnef Apr 09 '10 at 06:33
-
I got my answer anyway, # For XML data use org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl - creates XML and For XMI data use org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl - creates XMI. I understand XMI is a subset of XML File, but they are different in functionality. – zengr Apr 09 '10 at 06:43
-
2I hate to say it but you still haven't understood. XMI is NOT a subset of XML; it is an APPLICATION of XML. You will almost certainly have problems later if you don't manage to understand the distinction. – Nic Gibson Apr 09 '10 at 12:06
-
thank you @RobertHarvey,`XMI is a specific application of XML` if possible, what is the other applications of XML ? – user2019510 Aug 12 '13 at 23:12
-
@RobertHarvey I didn't realize xmi in the list of xml application you provided ? – user2019510 Aug 13 '13 at 01:58
-
@user2019510: I don't understand your question. The Wikipedia list is probably not a complete list of XML standards, and XMI isn't just XML... See the accepted answer. – Robert Harvey Aug 13 '13 at 03:11
An XMI document is an XML document. An XML document is not necessarily an XMI document.
This is an XML document:
<myXml>
<myTag> myContent </myTag>
</myXml>
but it is not an XMI document.
XMI is a specific XML dialect. It consists of a specific set of tags with specific syntax and semantics aimed at describing a model.

- 20,112
- 21
- 72
- 113

- 7,358
- 6
- 47
- 84