You may specify the XML encoding to be used when saving the resource by using the {@link XMLResource#setEncoding setEncoding} method.
An XMIResource is capable of handling XMI files that contain IDs as well as XMI files that use URI fragments rather than IDs. The IDs from an XMI file are stored in the XMIResource in the {@link XMLResource#getIDToEObjectMap idToEObjectMap} and the {@link XMLResource#getEObjectToIDMap eObjectToIDMap}.
When saving an XMIResource, the ID of an object is saved if an object has one. If a referenced object has an ID, it is used rather than a URI fragment. You may clear the Maps that contain IDs if you wish to use URI fragments rather than IDs.
An XMIResource does not create IDs for you automatically; you can set IDs for objects yourself. However, we recommend that you use URI fragments instead because their use reduces the size of XMI files and memory consumption as well.
@see org.eclipse.emf.ecore.resource.Resource @see org.eclipse.emf.ecore.resource.impl.ResourceImpl @see org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl
|
|
|
|