|
|
|
|
Re: [Edapt] DiagnosticException while migrating [message #1767196 is a reply to message #1767183] |
Mon, 03 July 2017 08:54   |
Eclipse User |
|
|
|
Hi Johannes,
thanks for your feedback.
Oh yah there are some additional attribues from an much earlier implementation. These are ignored by seeting XMLResource.OPTION_RECORD_UNKNOWN_FEATUR to true
package de.bahntechnik.dd.opn.engine.util;
/**
* Creates an instance of the resource. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated NOT
*/
@Override
public Resource createResource(URI uri) {
XMLResource result = (XMLResource) createResourceGen(uri);
result.getDefaultSaveOptions()
.put(XMLResource.OPTION_KEEP_DEFAULT_CONTENT, Boolean.TRUE);
result.getDefaultLoadOptions()
.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
return result;
}
/**
* Creates an instance of the resource. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
*/
public Resource createResourceGen(URI uri) {
XMLResource result = new OpnengineResourceImpl(uri);
result.getDefaultSaveOptions()
.put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
result.getDefaultLoadOptions()
.put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION,
Boolean.TRUE);
result.getDefaultLoadOptions().put(
XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
result.getDefaultSaveOptions().put(
XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
result.getDefaultLoadOptions()
.put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
return result;
}
Regarding the validate_validContainment.
instance is "Instance of Railml"
container == 0
resources == 0
final boolean valid = container == 1 && resources <= 1 || resources == 1 && container <= 1;
I belive this is because the root of the EMF model is DocumentRoot and the root of the XML is <railml>.
We do not use a own ResourceSetFactory or ResourceSet implementation.
We currently try to remove the DocumentRoot from our EMF model but this is not jet finished. As we need to make sure we still can read existing files withour problem.
thanks for your thoughts, Martin
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04630 seconds