问题
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.
回答1:
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.
Proprietary solutions: Altova (30 days free), IBM Rational Arcitect (non-standard UML),
来源:https://stackoverflow.com/questions/22024034/xsd-to-uml-command-line-tool