The appropriate ResourceFactory to load a file used to be chosen
a) URI-based
b) extension based
Now a content-based choice, if available, precedes the extension-based.
At the platform level these are registered and can be browsed in
Windows->Proferences->General->Content Types.
Content types are defined by the
org.eclipse.core.contenttype.contentTypes extension point with an
associated content describer. See org.eclipse.ocl/plugin.xml for a
non-trivial example.
EMF enables these via the Model.Content Type Identifier genmodel field,
leading to an eCONTENT_TYPE in the Package class. NB genmodel doesn't
update plugin.xml at all, so you might want to experiment creating from
your Ecore model from scratch to see what a virgin plugin.xml copuld
look like.
The ResourceSet load on finding an XML file offers the file to each of
the registered content describers. These can prioritise their
appropriateness allowing the best to be chosen. It is the the backstop
XML handler that crashes on non-XML. Prior to the backstop EMF supports
a namespace-based dispatch of XML to a model-specific loader. You can
therefore have 100 different meta-models all sharing the .xml extension.
The code is not trivial to understand with the platform performing a
useful job in not quite the way that suits EMF, so EMF fights it a bit.
If you put in your own describer, you can probably do interesting things.
There might be a tutorial now. 'content type' and 'content describer'
are the important keywords.
Regards
Ed Willink