https://github.com/peteruhnak/xmi-analyzer
A utility for XMI analysis
https://github.com/peteruhnak/xmi-analyzer
Last synced: about 2 months ago
JSON representation
A utility for XMI analysis
- Host: GitHub
- URL: https://github.com/peteruhnak/xmi-analyzer
- Owner: peteruhnak
- License: mit
- Created: 2016-04-29T15:17:43.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-15T18:35:39.000Z (almost 5 years ago)
- Last Synced: 2025-02-09T18:52:06.709Z (3 months ago)
- Language: Smalltalk
- Size: 627 KB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **REPO MIGRATED TO https://github.com/moosetechnology/xmi-analyzer**
I no longer maintain this project, please follow the link above.
---
# XMI Analyzer
[](https://travis-ci.org/peteruhnak/xmi-analyzer) [](https://coveralls.io/github/peteruhnak/xmi-analyzer?branch=master)XMI Analyzer is a (prototype) utility assisting in analyzing XMI files.
Sponsored by [Synectique ](http://synectique.eu/)
Note that XMI is a subset of XML with rather specific rulues.
* For free-form-ish XML you might be interested in https://github.com/peteruhnak/xml-magritte-generator
* For generic XMI see https://github.com/OpenPonk/xmi
* this project should migrate to use that at some point## Installation
```
Metacello new
baseline: 'XMIAnalyzer';
repository: 'github://peteruhnak/xmi-analyzer/repository';
load.
```Instead of operating on the DOM this tool will generate appropriate classes for the individual node types and will instantiate them from the XMI.
The instantiation includes:
* basic type inference (booleans, numbers, strings, IDREF(s))
* reference resolution
* instead of having string IDs in the DOM, the instances will have proper object references## Usage
```smalltalk
"get an instance of DOM tree"
"dom := XMLDOMParser parse: FileLocator home asFileReference / 'prog/xmi/examples/smr2.xml'."
dom := XMIAnalyzer sampleStateMachineXmi."Generate the necessary classes. Prefix will be added before all generated classes."
XMIAnalyzer createClassesFor: dom prefixed: 'SMX' in: 'MyGeneratedClasses'."Create the instances in the generated classes."
instance := XMIAnalyzer createInstanceOf: dom prefixed: 'SMX'."Inspect the instance"
instance inspect."Apply a simple Mondrian demo visualization (requires Roassal)"
(XMIAnalyzer sampleStateMachineVisualization: instance) open.
```## Example
In-image example is available after running `XMIAnalyzer>>exampleStateMachineScenario`
Example usage on some XMI:

Original XMI

Generated classes for the tree

Inspecting the instantiated model

Simple Roassal visualization of the content.
