Book a Demo

Author Topic: Generating Custom XML  (Read 4314 times)

albinofrenchy

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Generating Custom XML
« on: May 20, 2010, 02:51:16 pm »
We'd really like to be able to generate custom XML for UML model using the code generation capabilities of EA. The problem is is that we'd want it to just generate one file and be able to apply rules to packages (namespaces) in such a way that we could nest classes and all that.

Is this possible with the code generation in EA? XSLT against XMI and Add-Ins are our absolute last resort, is there any other options for this? Is it possible to modify the XML generation tool in EA?

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Generating Custom XML
« Reply #1 on: May 20, 2010, 07:37:22 pm »
Hi,

I don't believe that there's a way to customize how the XMI compliant model export is done by EA. There's the standard part and the UML tool vendor specific informations, and how this is generated is steered by EA internally. The process supports to export other vendor specific formats (e.g. Rational Rose) and some more options, see here:
http://www.sparxsystems.com/uml_tool_guide/model_management/importexport.htm

But what's wrong with XSLT to bring that to any format you'll need? At least it would be nice to have a XSD-schema definition for the EA specific stuff (was recently requested here in the forum). Anyway, optionally you may have a DTD schema exported for XMI 1.1 format.

HTH
g.

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Generating Custom XML
« Reply #2 on: May 25, 2010, 09:51:05 pm »
Hi,

I think it is not possible in EA to customize the generation of XMI directly. For my XMI format, I had first realized an XSLT transformation to from EA XMI 2.1 to my XMI format, but mine was extremely different. So I needed too many templates and after every change in the EA XMI format, I needed to change my transformation.

So I have written an  own export in my addin. Using the EA API I extract the information from the Repository and write it to an DOM tree.

This isn't the best way, but it works.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generating Custom XML
« Reply #3 on: May 26, 2010, 03:54:34 pm »
If all you are after is anohter xml schema generation then the one provided by EA then I wouldn't go down the XMI path.
XMI is pretty complicated, and it will probably take a lot of time to get the transformation to work correctly.
I think you are probably best of writing a little addin against the API, and construct the xml yourself.

Geert