|
|
|
Re: xsd to Ecore: Trouble with xsd:Extension [message #1852456 is a reply to message #1852449] |
Tue, 17 May 2022 06:33 |
Ed Merks Messages: 32985 Registered: July 2009 |
Senior Member |
|
|
I asked because the generated resource factor's create method looks like this: /**
* Creates an instance of the resource.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Resource createResource(URI uri) {
XMLResource result = new DcResourceImpl(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;
}
Without those options, it's not going to work. Worse still, you don't actually use a resource factory or the resource set at all, you directly create an XMLResourceImpl.
I'd suggest invoking Generate Test Code and look for the XyzExample.java. The generated main method will show how to read and write resources properly/correctly. Copy and paste from that...
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02246 seconds