XSD to UML command line tool
Asked Answered
F

1

2

I was wondering, does anyone come across any command line tool (free in preference) for translating an xml schema (xsd) to UML diagram?

The .xsd is used to represent classes, thus a UML class diagram would fit the purpose.

I would be more interested in a command line tool, as i would like to make it an automatic task, thus i would rather not have to open a UI to perform it.

I have done some online research but most of the tools do require UI interaction.

Thank you for any suggestions.

Farsighted answered 25/2, 2014 at 19:19 Comment(1)
Would it be possible for you to describe why UML, and not a diagram designed for XSD? To begin with, there is no standardized UML profile for XSD, and in general, many aspects of the XSD constraints and structure would end up captured as tagged values that are not visible in the diagram, or stereotypes that are sometimes too cumbersome and noisy...Zn
S
2

An EMF Eclipse free solution:

  • Install Eclipse+EMF
    • Open the New EMF Generator model wizard (File->New->Other...->EMF Generator Model)
    • Choose a location and name for the GenModel (usually the place where you want your UML model to end up)
    • On the next page choose "XML Schema" as import source
    • Choose the Schema(s) to import on the next page
    • The final page of the wizard shows you the EMF models that will be created and lets you edit their file names (they will be co-located with teh Genmodel)
    • finish the wizard
    • you should end up with one or more *.ecore files for your schemas and an open editor showing your newly created Genmodel.
    • From the editor's context menu choose "Export model...", "UML Model", a target directory and all models to convert (usually all would be a good choice) and finish.

    You should end up with UML models for your schemas and probably an ecore.uml with some Ecore infrastructure classes.

Other free Eclipse solutions: Hypermodel, EDNA

Proprietary solutions: Altova (30 days free), IBM Rational Arcitect (non-standard UML),

Stephanistephania answered 25/2, 2014 at 21:52 Comment(4)
Hello Gangnus, thank you for the answer. I will give it a try, but i was more interested in a command line tool, that can be invoked as part of an automatic process. That is the reason i wanted to avoid any UI, as it involves human interaction.Farsighted
@Farsighted What is the use of diagrams if we escape the human interaction? I would check these Eclipse tools - some of them could have the possibility to have xsd and uml as different views of the same thing. As for command line tool - I think you want too much :-) - again for Eclipse tools the command line launching possibility is a tradition...Stephanistephania
Of course the diagrams will be viewed by people, but what i would like to avoid is the interaction when creating those diagrams. I have a small OO DSL which i translate into XSD and i would like to produce a UML (e.g. a png picture of the diagram) to see the relations between the classes in my DSL. I would like this to be part of my build process, so that's the need for a command line tool , which will be triggered by the build server. Indeed i will check the tools you suggested, as they might lead me to what i want. Thank you :)Farsighted
@Farsighted I see. The automatic diagramming. I was looking for that too, only for java code. There are some Eclipse tools... The IBM tool definitely can do it, but it is far from being free or cheap. And its UML is not standard. And usual bad support of IBM...Stephanistephania

© 2022 - 2024 — McMap. All rights reserved.