XMI attribute lost [message #1073373] |
Wed, 24 July 2013 12:08  |
Eclipse User |
|
|
|
Hello!
I'm working on a Eclipse plugin to do some M2M and M2T operations. I´m using a acceleo project inside it. I have a M2M transformation(executed with ATL) that generates a *.uml model, the problem is that when it is executed like a Eclipse project it generate a complete model like the following piece of code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="20110701" xmlns:xmi="an url to omg.org/spec/XMI/20110701" xmlns:xsi="an url to w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmlns:utp="an url to ///schemas/utp/_uoEXwIotEeKWU4o6i4Yn9w/0" xsi:schemaLocation="an url to ///schemas/utp/_uoEXwIotEeKWU4o6i4Yn9w/0 Metamodels/utp.uml#_u6Zd4YotEeKWU4o6i4Yn9w">
<uml:Model xmi:id="_6u2dgPRTEeKvTd0G14kV5g" name="testing_test">
<elementImport xmi:id="_6u2dgfRTEeKvTd0G14kV5g" alias="System Under Test">
On the other hand, if I execute it like a plugin the same part of the model generated is the next:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0"
xmlns:xmi="an url to www.omg.org/XMI" xmlns:xsi="an url to w3.org/2001/XMLSchema-instance" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmlns:utp="an url to ///schemas/utp/_uoEXwIotEeKWU4o6i4Yn9w/0">
<uml:Model name="testing_test">
<elementImport alias="System Under Test">
(I have modified the urls because the restriction)
It seem that don't find the same xmi version, I too notice that in all the elements in the first model(the correct one) appear a xmi:id and/or xmi:type and in the incorrect model only xsi:type without id.
Any suggestions?
Thanks!
|
|
|
|
|
Re: XMI attribute lost [message #1074999 is a reply to message #1074677] |
Sun, 28 July 2013 07:32   |
Eclipse User |
|
|
|
Thanks for your answer Ed.
I´ve tried what you said, I save the model like this:
IExtractor extractor = new EMFExtractor();
extractor.extract(outModel, target, options);
Where options are:
HashMap<String,Object> options = new HashMap<String,Object>();
options.put("supportUML2Stereotypes", "true");
options.put("printExecutionTime", "true");
options.put("allowInterModelReferences", "true");
options.put("OPTION_SCHEMA_LOCATION", "file:/"+path");
But it doesn´t works. Thank you for your help Ed.
|
|
|
Re: XMI attribute lost [message #1075246 is a reply to message #1074999] |
Mon, 29 July 2013 01:32   |
Eclipse User |
|
|
|
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi<br>
<br>
I write earlier:<br>
<br>
<blockquote>Whether an xsi:schemaLocation is generated depends on
the options map passed to save(). The relevant XMLResource
option is
<br>
<br>
/**
<br>
* Produce an xsi:schemaLocation/xsi:noNamespaceSchemaLocation
in the saved result.
<br>
*/
<br>
String OPTION_SCHEMA_LOCATION = "SCHEMA_LOCATION";
<br>
</blockquote>
<br>
The options are not typed so you must check the type yourself. The
Javadoc doesn;t mention the type explicitly but it really only
gives you two options so it is Boolean.<br>
<br>
It is always good to search for example when unsure. How about the
first search return that I get:<br>
<br>
result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION,
Boolean.TRUE);<br>
<br>
Regards<br>
<br>
Ed Willink<br>
<br>
On 28/07/2013 12:32, Jesús Muñoz wrote:<br>
</div>
<blockquote cite="mid:kt2vge$5jp$1@xxxxxxxxe.org" type="cite">Thanks
for your answer Ed.
<br>
<br>
I´ve tried what you said, I save the model like this:
<br>
<br>
<br>
IExtractor extractor = new EMFExtractor();
<br>
extractor.extract(outModel, target, options);
<br>
<br>
<br>
Where options are:
<br>
<br>
<br>
HashMap<String,Object> options = new
HashMap<String,Object>();
<br>
options.put("supportUML2Stereotypes", "true");
<br>
options.put("printExecutionTime", "true");
<br>
options.put("allowInterModelReferences", "true");
<br>
options.put("OPTION_SCHEMA_LOCATION", <a class="moz-txt-link-rfc2396E" href="file:/">"file:/"</a>+path");
<br>
<br>
<br>
But it doesn´t works. Thank you for your help Ed.
<br>
</blockquote>
<br>
</body>
</html>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05138 seconds