xsd - How to map xs:any in EMF Ecore? -


i have following type in xsd:

<xs:complextype name="vendorspecifictype">     <xs:sequence>         <xs:any namespace="##any" processcontents="skip" maxoccurs="unbounded"/>     </xs:sequence> </xs:complextype> 

i created type in ecore:

ecore type

i tried inject xml containing following tags:

<vendorspecific>     <vendor id="1"/> </vendorspecific> 

but crashes

org.eclipse.m2m.atl.core.atlcoreexception: error loading test.xml: org.eclipse.emf.ecore.xmi.featurenotfoundexception: feature 'vendor' not found. 

the code used inject models in metamodels tested , working. test.xml loaded correctly if remove vendor tag.

my question how map xsd ecore type can loaded?

update:

after debugging, seems code use inject model ecore model not complete: extendedmetadata null

// load in metamodel ireferencemodel metamodel = modelfactory.newreferencemodel(); injector.inject(metamodel, metamodelpath);  model = modelfactory.newmodel(metamodel); injector.inject(model, modelpath); 

how tell load metadata?

i added following line

((emfmodelfactory) modelfactory).getresourceset().getloadoptions().put(xmlresource.option_extended_meta_data, boolean.true); 

before injecting metamodel.

it works now!


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -