General (#1) - xsi schema location in transformed model (#18) - Message List

xsi schema location in transformed model
 unsolved

hi all!

i'm using the EMFQvtProcessorImpl to transform my ecore models "by hand". The target model is missing the xsi:schemaLocation attribute, so i get a PackageNotFoundException when trying to open it with a (reflective) ecore editor. is there any way to have the processor insert this attribute or to avoid the error?

thanks in advance! martin

  • Message #44

    when you save the target model resource, add the following option:

    XMLResource xmlResource = (XMLResource) resourceIterator.next();
    xmlResource.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); `
    xmlResource.save(Collections.EMPTY_MAP);
    
    • Message #45

      cool. thanks. that's what i was looking for. but here's still an issue: how do i suppress creation of the fragment pointing to an id? i.e.

      xsi:schemaLocation="foo foo.ecore"
      

      instead of something like

      xsi:schemaLocation="foo foo.ecore#_SSltMPzJEdy8la3z7ZOuWw"
      

      EDIT: i just decided to add the generated id to the meta model. works fine so dont bother ;)

Attachments

No attachments created.