Reading XMI with non-XMI elements [message #1871127] |
Mon, 16 September 2024 11:45  |
Eclipse User |
|
|
|
I want to process a UML model created with Enterprise Architect (EA) and have exported it using their Publish tool as UML 2.5 / XMI 2.5.1.
I have a UML metamodel covering the necessary UML language elements, like Class, Package Property etc, and can load these parts from the XMI file. However, most of the content is within an xmi:Extension-element with a structure that does not seem to follow normal XMI structure:
<xmi:Extension extender="Enterprise Architect" extenderID="6.5">
<elements>
<element xmi:idref="EAPK_403CB" xmi:type="uml:Package">
<model package2="EAID_403CB" package="EAPK_FC2F" tpos="0" ea_localid="54939" ea_eleType="package"/>
<properties isSpecification="false" sType="Package" nType="0" scope="public" stereotype="ApplicationSchema"/>
<project author="haukdal_ivar" version="1.0" phase="1.0" created="2018-05-14 07:54:14" modified="2024-09-11 12:17:24" complexity="1" status="Proposed"/>
<code gentype="Java"/>
<style appearance="BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=1;HSwimLanes=1;BorderStyle=0;"/>
<tags>
<tag xmi:id="EAID_89E8" name="SOSI_kortnavn" value="BGF" modelElement="EAID_40CB"/>
<tag xmi:id="EAID_5201" name="SOSI_langnavn" value="Bakkegeofysikk" modelElement="EAID_40CB"/>
E.g. the "elements" (or"tags") element seems to correspond to a feature (without instance creation) with contained "element" (or "tag") elements corresponding to the actual instances populating this features. This is contrary to XMI where elements named after a feature implicitly also corresponds to an instance (creation) with a type specified by xmi:type attributes. Also, the "element" element looks up an existing one using xmi:idref (supported by XMIHandler), but contains more elements which the XMIHandler does not support.
So far I've created a separate Extension class with the idea of creating classes corresponding to the contained elements, but will also need to handle the non-XMI structure. I'm wondering how the XMIHandler can be extended to handle these kind of elements,. or if the Extension class and the others I create can be configured/annotated to handle the above element structure.
Any suggestions?
Regards,
Hallvard Trætteberg
|
|
|
|
|
Re: Reading XMI with non-XMI elements [message #1871286 is a reply to message #1871244] |
Thu, 19 September 2024 07:23  |
Eclipse User |
|
|
|
In my case the xmi:Extension element includes important information here and there, including tagged values and basic types used by the main model, so I will need to dig into it. My plan is to model the stuff I need and make a custom XMIHandler that creates instances (of my model classes) from the relevant elements, while ignoring the rest.
|
|
|
Powered by
FUDForum. Page generated in 0.03752 seconds