| XMI to java objects [message #878067] |
Mon, 28 May 2012 09:00  |
Kosala Yapa Messages: 132 Registered: September 2010 |
Senior Member |
|
|
Hi there,
How to create java objects from an XMI file(target.xmi)?
option 1: I know, it must be possible reading through an XML parser. // I do not like this approach, it is a lot of coding.
option 2: I know, eclipse EMF provides EMF generator model. I could manage to take Generate Model Code from the .ecore model related to this XMI file (target.ecore). The generated code consist of model, model.impl and model.util. Now, Is it possible to use these coding to read XMI file to generate java objects? How to do that?
I am trying to create java objects from the following XMI file(target.xmi).
<?xml version="1.0" encoding="ISO-8859-1"?>
<target:Device xmi:version="2.0" xmlns:xmi="...//www.omg.org/XMI" xmlns:xsi="...//www.w3.org/2001/XMLSchema-instance"
xmlns:target="target"
name="PSSuniversal22222"
s7DeviceReference="{7F6AC5F1-E8E0-49E5-ABA1-26E4A6A74175}{001417C3-00000003-001417B3-00000002-00112001-00000107}{SD_example1}">
<Module name="PSSuES4DO0.5_1"
deviceID="0x00000C00"
s7ModuleReference="CFAF3ED5-37E4-476B-AE64-94FDD6429D1E}{001417C5-00000009-001417C3-00000003-00112001-00000107"
isSelectedWithinStep7="false"/>
<Module name="PSSuniversal33333"
deviceID="0x00000229"
s7ModuleReference="CFAF3ED5-37E4-476B-AE64-94FDD6429D1E}{001417C5-00000009-001417C3-00000003-00112001-00000108"
isSelectedWithinStep7="false"/>
<HeadModule xsi:type="target:Module"
name="PSSu E F PS (PROFIsafe)"
deviceID="0x00000801"
s7ModuleReference="{9A856DAC-1D0A-46F7-B69F-40E2DC6511DD}{001417C5-0000002F-001417C3-0000002A-00112001-00000107}{SD_example1}"
isSelectedWithinStep7="false"/>
</target:Device>
Thanks in advance.
Kosala
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: XMI to java objects [message #879637 is a reply to message #879625] |
Thu, 31 May 2012 10:59  |
Ed Merks Messages: 24529 Registered: July 2009 |
Senior Member |
|
|
Best to ask on the ATL newsgroup.
On 31/05/2012 4:35 PM, Kosala Yapa wrote:
> Hi,
>
> This is done now. Thanks a million Merks.
> Presently, I am running this ATL program using eclipse Run
> Configuration. I am exploring, how to run this transformation using a
> java program.
> org.eclipse.m2m.atl.engine.AtlLauncher looks like a possible approach.
>
> Do you have any clue, any easy way to do this?
>
> Thanks
> Kosala
|
|
|
Powered by
FUDForum. Page generated in 0.05104 seconds