Reverse engineer DataBase (episode 2) Generating Class Diagram Image from XMI.

in my last article (Reverse engineer DataBase to XMI.)

I wrote how to reverse  engineer DataBase and produce XMI file from the data base using andromda Schema2xmi plug-in.

in this article I will speak about how to produce PNG (Portable Network Graphics) Image or any other type of Image that produces the Class Diagram representation from the XMI file that we produced earlier from our Data Base.

ok lets start.

I will use XSLT, and graphviz to achieve this task.

Prerequisites:

   1. XSLT 2.0.

   2. graphviz.

Requiered steps to generate the png class diagram from our xmi file are:

  1. Write XSL file that generate the dot file from our xmi.
  2. Generate the dot file using the XSL file.
  3. Use graphviz to generate the png image from the dot file.

1. Writing the XSL transformer file that generate the dot file from our xmi:

the following is the XSL file (XMITransformer.xsl) that applies to our xmi file and produces the dot file from it.

­


<xsl:stylesheet version="2.0"      
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"      
                xmlns:xlink="http://www.w3.org/1999/xlink"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
                xmlns:UML="org.omg.xmi.namespace.UML"     
                exclude-result-prefixes="xs xdt UML">

    <!--xsl:key name="class" match="UML:Class" use="@xmi.id" /-->
    <xsl:output method="text" media-type="text/xml" indent="yes" encoding="ISO-8859-1" />
    <xsl:variable name="from" select="0"/>
    <xsl:variable name="to" select="NON"/>
    <xsl:template match="XMI.header"/>
    <xsl:template match="XMI.content">
        <xsl:call-template name="pre-graph"/>
        <xsl:apply-templates
                    select="UML:Model/UML:Namespace.ownedElement/UML:Package/UML:Namespace.ownedElement/UML:Class" />     
        <xsl:apply-templates
                    select="UML:Model/UML:Namespace.ownedElement/UML:Package/UML:Namespace.ownedElement/UML:Association"/>
        <xsl:call-template name="post-graph"/>
        <!--xsl:call-template name="attributes"/>
        <xsl:call-template name="functions"/-->
    </xsl:template>
      
    <xsl:template name="attributes">
        int x;
    </xsl:template>
      
    <xsl:template name="functions">
        public static void main(String[] args){
        }
    </xsl:template>
      
    <xsl:template name="pre-graph">
        digraph g {      
        graph [      
        rankdir = "LR"      
        ];

        node [      
        fontsize = "16"      
        shape = "ellipse"
        ];
      
        edge [
        ];
    </xsl:template>
      
    <xsl:template name="post-graph">
        }
    </xsl:template>
      
    <xsl:template match="UML:Namespace.ownedElement/UML:Class">
        <!--"<xsl:value-of select="@xmi.id"/>" [
        label = "<xsl:value-of select="@name"/>"
        shape = "record"
        ];-->
        "<xsl:value-of select="@xmi.id"/>" [
        label = "<xsl:value-of select="@name"/> | <xsl:value-of select="@visibility"/> |  "
        shape = "record"
        ];
      
        <!--xsl:text>  </xsl:text>
        <xsl:value-of select="@visibility"/-->
        <!-- new Line character-->
        <!--xsl:text>&#xa;        </xsl:text-->
    </xsl:template>
      
    <xsl:template match="UML:Association.connection">
        <xsl:apply-templates select="UML:AssociationEnd/UML:AssociationEnd.participant/UML:Class"/>
    </xsl:template>

    <xsl:template match="UML:Association">
        <xsl:variable name="f"
                      select="UML:Association.connection/UML:AssociationEnd/UML:AssociationEnd.participant/UML:Class/@xmi.idref"/>
        "<xsl:value-of select="$f[1]"/>" -> "<xsl:value-of select="$f[2]"/>" [
        id = <xsl:value-of select="@xmi.id"/>
        ];
    </xsl:template>

    <xsl:template match="UML:Attribute">
    </xsl:template>      
</xsl:stylesheet>

­

2. Generate the dot file using the XSL file:

 java net.sf.saxon.Transform -o dotFileName.dot transformed.xmi XMITransformer.xsl

3. Use graphviz to generate the png image from the dot file:

dot -Tpng -o Diagram.png dotFileName.dot

voyance amour

This is some amazing post. I really liked this. I hope that I can get
more such posts in the future. Please, don't disappoint me. Cheers! and
thank you mate !!!!

voyance amour

Asking an tactile learner to

Asking an tactile learner to learn in a classroom lecture setting is like asking him to learn a foreign language by reading it. Some education is best delivered by a particular route and some learners receive information best by a particular route. sources tell me

You need to hire an Indian

You need to hire an Indian weblink developing organization that gathers high quality backlinks for you. You need to hire an Indian weblink developing organization that gathers high quality backlinks for you. click for source

Search search engines are a

Search search engines are a significant aspect of internet business. To make its presence felt among the visitors or audiences, your web page must appear in greater webpages of top search engines like Google, Yahoo, MSN and so on. buy reddit votes

This next stage for SEO

This next stage for SEO professionals is to draw in the correct focus on audience for your website. They can accomplish this link-building in sites where your focus on audience are and enhance your website there. buying reddit upvotes

Awesome and interesting

Awesome and interesting article. Great things you've always shared with us. Thanks. Just continue composing this kind of post.   series online

Interesting here

This is pretty interesting read if you ask me. You can trace any mobile phone number and find location from any map in the world for free. Download here Mobile phone tracker for free of charge Cell Phone Tracker Download Tool

It is which problems most

It is which problems most and results in improving the guests to your website and thereby resulting in into a variety of customers and customers, again which gradually provides more earnings for you. important site

Great,. thanks for this

Great,. thanks for this post,. its very informative and well written. very helpful.. buy social media services

I really enjoy simply

I really enjoy simply reading all of your weblogs. Simply wanted to
inform you that you have people like me who appreciate your work.
Definitely a great post. Hats off to you! The information that you have
provided is very helpful. website

Is actually Competitive SEO

Is actually Competitive SEO the best SEO Coaching Course available for you? the post right here

At first every procedure is

At first every procedure is performed step by step and then progressively this method especially the content distribution needs procedure and regular updation through the fresh article that could update the guests about the current status of the organization and its different products. go to website

First factor an excellent

First factor an excellent SEO organization is going to do is talk about your suggested keywords and words and keywords and words. Using market and keyword and key term research tools they ought to talk about and suggest the most appropriate keyword and key term and check term choice for your business. TikatoShop

Without fail, my phone rings

Without fail, my phone rings before three minutes pass, or I think, guiltily, that I could be writing to a legislator and making more productive use of my time. How sick I am of feeling guilty. annuairepagesblanches.org

By forcing bad media onto

By forcing bad media onto the second, third, and fourth webpages of Google, those webpages will be avoided from getting grip or attention. strategy

This implies marketing

This implies marketing exclusively for Once you opt for SEO techniques, marketing performs a crucial part. inmodaveritas.com

Foster and Partners have

Foster and Partners have realized their stadium of superlatives in a magnificent manner, it has turned out to be a striking, urban space-creating structure. use this link

Great Information

It's really nice and meanful. it's really cool blog. Linking is very useful thing.you have really helped lots of people who visit blog and provide them usefull information.Avocado Oil Benefits For Skin

Still with the aid of

Still with the aid of professionals and sufficient personal effort you can zero in on some outstanding seo organization and make them execute for you. here are the findings

There are two kinds of SEO

There are two kinds of SEO techniques namely moral and illegal. While illegal techniques can get you the position in a smaller period of your energy and effort there is a great risk of using such techniques. you can look here

CSNK

If you are thinking about on the internet company plan then I would just like to offer you a primary knowing of what the globally web company structure is all about
We are the professional clothing manufacturer

The truth is, there are many

The truth is, there are many of western functions wanting to create a fast 'buck' out of the ones that are basically unacquainted with the 'black art' procedure of SEO or Look for Motor Optimization. coin pouch

The local SEO or else the

The local SEO or else the local online seo makes it possible for in concentrating of the local google to divert their look for for the web page. pathology lab hadapsar

Whenever you hire an

Whenever you hire an experienced, expert SEO Support, you interact with the abilities of individuals which comprehend just how to help your web page to the optimum of the look for engines' positions and ensure that is remains there. Warren

I found your this post while

I found your this post while searching for some related information on blog search...Its a good post..keep posting and update the information.
high pr backlinks

The capture is, regardless

The capture is, regardless of what position you obtain on your web site or content, if no one is aware of it, or if everyone prevents studying 50 percent way through, everybody drops. Dean Graziosi

There are a wide range of

There are a wide range of SEO organizations out there, yet very several of these organizations has been targeted at supplying the people with highest possible value for cash. find here

Aside from invigorating an

Aside from invigorating an exerciser via a challenging work out, a numerous drinking routines improves our health and health and fitness and helps in colon each day. leather coin pouch

With countless numbers

With countless numbers regarding different organizations currently destroying the market, looking for a organization that really provides highest possible value for the cash you pay can confirm to be quite a issue, and even more important, the thing you'll want to keep in thoughts is the point that many organizations out there are usually in it for the cash only. High quality albums

You can even do simple body

You can even do simple body system weight training exercises with plenty while you take a seat on the seat or floor. There's usually ways to press far more training into the day. car hire in portugal

You can even do simple body

You can even do simple body system weight training exercises with plenty while you take a seat on the seat or floor. There's usually ways to press far more training into the day. car hire in portugal

These poor can furthermore

These poor can furthermore help you plan the major terms that you can use to help your website seem at whatever factor it is desired by the consumer. www.triviacrackhack.net/

Discover out the most

Discover out the most cost-effective and efficient SEO: The two stability described up are alone the primary achieve to round your restricted consideration with your SEO specifications. To get the cope, to get the casework you want, you cost to purchase out that particular consideration company. download games for pc

To even more have an

To even more have an knowing of the idea of SEO, its important to have an knowing of to begin with how look for search engines like google operate. look at here now

Excellent piece of writing!

Excellent piece of writing! This is just phenomenal work from you. Of all the piece of work I've read over the past few years, I've liked this one the best. Keep it up!
Snapchat spy chats and photos http://snapchathackapp.com/

Their work techniques and

Their work techniques and techniques are instructed to achieve optimum customer care in shorter period. Your support encounter will be completely personalized according to your needs. look at here now

Anonymous

Very Nice Article Thanks For Sharing.. Very useful information.. Keep it up..
Funny Mothers Day Quotes

Eid Mubarak Wishes,
Ramadan Fasting Times, Fathers Day Quotes,

Now do compare & contrast

Now do compare & contrast with the packages and select the one which suit­s your needs in an efficient way and brings long term result.  Domina tu Orgasmodoes The Ex Factor workThe Drama Method

I have read this post and if

I have read this post and if I could I wish to suggest you few interesting things or advice. ­ Old School New BodyUltimate Herpes Protocol Reviewdoes Real Writing Jobs work

I wrote how to reverse

I wrote how to reverse engineer DataBase and produce XMI file from the data base using andromda Schema2xmi plug-in. www.tikatoshop.it

I wrote how to reverse

I wrote how to reverse engineer DataBase and produce XMI file from the data base using andromda Schema2xmi plug-in. www.tikatoshop.it

Top seo consistently

Top seo consistently scrutinizes more than three hundred Seo companies as a way to locate the one that is the top amongst the rest. http://hydrationbeltduringrace.webs.com/

SEO Company.SEO-India

SEO Company.SEO-India provides a variety of web growth and check engine optimization help, efficiently, on efforts and within budget. We are your single source connection to freelancing from Indian, web style web solutions of the finest top quality. Today, there is lots of competition in IT, and your web page can not be efficient in gaining the target viewers and the preferred results if only a simple HTML program, and it should be amazing, developing technological innovation, and it looks in existence. look here

And besides, I was married!

And besides, I was married! Why was I even considering that way? So perform ongoing on normally. article

When you genuinely need an

When you genuinely need an answer or some clarifications never hesitate to ask the SEO agency London about it. Good SEO companies will be glad to answer your project related queries in a timely fashion when it comes up. click to read

The shops have commitment

The shops have commitment programs that will provide you excellent discount rates and sales all through the year. So, you can keep improving your home with new at every opportunity. mode en 2015

Whenever you have website

Whenever you have website problems, SEO organization is on the way to provide you. Most of the times, your employees will be extremely trained in what they do, but this is really not a need with your web growth. article

I am going to Rome probably

I am going to Rome probably in 04/2014 for a month. I also want to visit florence, athens and amalfi coast but especially sites of antiquiy. Interest Rate Policy

And now you have an vacant

And now you have an vacant mild bulb! That is definitely the most challenging aspect of the effort. Next, put sticky plastic bumpers on the aspect of the mild bulb to keep it stable. chen-scholarship.org

Powered by Drupal - Design by artinet