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
2010-04-09 04:55:14
can XMI be used in place of XML? That was my question.
zengr
2010-04-09 04:57:00
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
2010-04-09 05:01:06
XML is used as a part of XMI, so if you're using XMI then you're using XML.
dingle_thunk
2010-04-09 05:01:45
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
2010-04-09 05:07:49
@zengr: All XMI files are XML, but not all XML files are XMI.
Robert Harvey
2010-04-09 05:09:11
+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
2010-04-09 05:08:40
Well, I already answered the question once. Satisfactorily, I thought.
Robert Harvey
2010-04-09 05:11:01
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
2010-04-09 06:33:52
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
2010-04-09 06:43:12
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
2010-04-09 12:06:23