25

Can some one shed some light on the difference between XML and XMI? Can XMI be used in place of XML?

zengr
  • 38,346
  • 37
  • 130
  • 192

3 Answers3

21

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.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
7

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.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
  • 1
    Is this a StackOverflow doppelganger? – Anthony Forloney Apr 09 '10 at 05:09
  • 1
    Well, I already answered the question once. Satisfactorily, I thought. – Robert Harvey Apr 09 '10 at 05:11
  • go it, one last question, any way to convert XMI to XML?! – zengr Apr 09 '10 at 05:38
  • 3
    you 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
  • 2
    I 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
7

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.

Paolo
  • 20,112
  • 21
  • 72
  • 113
Andrea Sindico
  • 7,358
  • 6
  • 47
  • 84