tags:

views:

282

answers:

2

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

+5  A: 

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
can XMI be used in place of XML? That was my question.
zengr
And 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.
dominikh
XML is used as a part of XMI, so if you're using XMI then you're using XML.
dingle_thunk
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
@zengr: All XMI files are XML, but not all XML files are XMI.
Robert Harvey
+3  A: 

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
Is this a StackOverflow doppelganger?
Anthony Forloney
Well, I already answered the question once. Satisfactorily, I thought.
Robert Harvey
go it, one last question, any way to convert XMI to XML?!
zengr
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.
dominikh
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
I hate to say it but you still haven't understood. XML 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 udnerstand the distinction.
Nic Gibson