Difference between XML and XMI?
Asked Answered
S

3

26

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

Seizing answered 9/4, 2010 at 4:49 Comment(0)
E
23

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.

Enlil answered 9/4, 2010 at 4:55 Comment(7)
can XMI be used in place of XML? That was my question.Seizing
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.Keyboard
XML is used as a part of XMI, so if you're using XMI then you're using XML.Palliate
so, that means, when I am required to deliver an XML file, if my code created a file called filename.xmi, I am correct?Seizing
@zengr: All XMI files are XML, but not all XML files are XMI.Enlil
Hi @RobertHarvey!I have a question:As you mentioned not all XML files are XMI then what it is?Alcoholicity
@Alcoholicity See my answer below.Enlil
E
8

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.

Enlil answered 9/4, 2010 at 5:8 Comment(9)
Is this a StackOverflow doppelganger?Hemolysis
Well, I already answered the question once. Satisfactorily, I thought.Enlil
go it, one last question, any way to convert XMI to XML?!Seizing
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.Keyboard
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.Seizing
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.Inessential
thank you @RobertHarvey,XMI is a specific application of XML if possible, what is the other applications of XML ?Alcoholicity
@RobertHarvey I didn't realize xmi in the list of xml application you provided ?Alcoholicity
@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.Enlil
P
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.

Pauperize answered 20/4, 2011 at 20:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.