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:
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
Post a Comment