Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: cpyf8rfAaap277 on March 09, 2015, 07:08:54 pm

Title: Export UML diagram to XML
Post by: cpyf8rfAaap277 on March 09, 2015, 07:08:54 pm
I have created a UML class diagram with few classes and added attributes with default values. In the next step I created objects from those classes and put them on a object diagram.
Now I want to export the information in an xml file, which will be the input for a project I’m actually working on.

The file has a specific form which looks like this for the class "component" with the attributes "ID" and "Memory":

<components>
      <component>
            <property name="ID" type="integer">0</property>
            <property name="Mem" type="integer">512</property>
      </component>
      <component>
            <property name="ID" type="integer">1</property>
            <property name="Mem" type="integer">128</property>
      </component>
</components>


“Export package to XMI” (Project ->Model Import/Export) exports the whole project with a lot of information which I do not need. Is it possible to select the elements and attributes which shall be exported? Or is there a smart plugin which could help me?

Thanks in advance!

Hans
Title: Re: Export UML diagram to XML
Post by: Eve on March 10, 2015, 08:44:17 am
I think you'll need to write something yourself to get output like that.
Title: Re: Export UML diagram to XML
Post by: heba on March 10, 2015, 10:39:55 am
XSLT can be your friend here.  I export XMI and let a XSL translator process the XMI outside EA for something similar.  Works quite well but is usually less compatible between the major XMI versions :(


-heiko