aspose file tools*
The moose likes Java in General and the fly likes Need to read XMI file through java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Need to read XMI file through java code" Watch "Need to read XMI file through java code" New topic
Author

Need to read XMI file through java code

Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi All,

Is there any way i can read an XMI file by writing java code rather that using nay tool(like EMF, MDI etc)? I want to write a java program which can read all the classes and attributes in an xmi file and then load then in the memory.

Please help.

Khushwinder
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
There are several file formats using the .XMI extension; assuming you're talking about this one, it looks like an XML format, so you should be able to use any XML library you like.
Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi Lester,

thanks for your reply. Actually i want to create a domain model for my project which will parse/read the different excel sheets and then will get the values of classes, relations and their instances. Hence i can not code the classes in the domain model directly as Java classes, and i have to implement a generic framework that can read any domain model (UML class diagram) from a file in a suitable format (XMI?).

So, i thought about the using xmi format for defining the uml classes format. Could you please tell me that am i going in right direction(by reading the xmi and store the classes,relationships in some variables and collection). Can you give me any other idea how to handle this situation?

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to read XMI file through java code