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

Seriously, if you can not

Seriously, if you can not cope with generally being managed, you ought to be a part of in soccer or the game of tennis or some other non-make get in touch with with activity. article

Jonathan Instant overlooked

Jonathan Instant overlooked the capability of the English and Irish audience with his indicated satirical brochure way returning in the 1700's. A Moderate Offer recommended that inadequate Irish family members offer their kids to wealthy Britons as meals. additional reading

Too many individuals that

Too many individuals that execute football usually do not invest the required time increasing their kicking game. These are usually individuals that execute relentlessly away from the market to enhance their information so they can also far better their action. here are the findings

As back hyperlinks increase

As back hyperlinks increase to these webpages, they become harder to eliminate. As back hyperlinks increase to these webpages, they become harder to eliminate. additional info read

Duplicate is attractive and

Duplicate is attractive and effective and the entertaining features of your website (such as online catalogs and e-commerce software solution application facilities) are working and easy to use. Not all of these items are the liability of the SEO. additional info read

You will have to give them

You will have to give them royals expenses or a amount of the earnings. Have them correspondence the hard hat and the jacket with the same name also. my link

Move within your abdomen

Move within your abdomen key to your backbone and carry it set for about 10 minutes, while respiration common. https://foldingbikereviewz.wordpress.com/

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.

   amacro

You won't have a trainer

You won't have a trainer shouting at you to present him 2 temps so you would not have group friends evaluating your create. article

Many individuals have

Many individuals have performed out golf with outstanding attention these days, and that attention always shows. click to find out more

I am certain there are many

I am certain there are many SEO companies who will recognize the argument, but will ask for within the Thousands or else huge figures to do this crazy marketing and marketing purpose. http://xboxgoldadvantages.webnode.com/

Because of to the impact of

Because of to the impact of search motor promotion on search motor positions in respect to websites, a whole lot of experienced Seo alternatives have come out in Calgary. here are the findings

At the time of looking for

At the time of looking for online resources, you will come across the fact that a large number of clients are waiting for you. Do a reality check for this purpose. You will observe that all the customers would not be interested in availing your products & services. binární opce

You know your projects stand

You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant!

http://rebelmouse.com/thediabetesprotocolreviews

As an experienced You use

As an experienced You use your minds to enhance somebody's business. The fact is that you are one of the smartest individuals on this planet with a very technological, statistical mind. click to find out more

SEO organization plan will

SEO organization plan will include sporadic development/effectiveness experiences to help you keep track of your weblog site improvement.Tracking your weblog site achievements is very important often.Primary, it informs in the event the SEO bring about does their profession.Next, it says to you when the SEO techniques, program, and method working or you cannot.3rd, it statements how well the various google are reciprocating your SEO projects. find here

In order to position in the

In order to position in the top ten for the key word "Search enginesIn, this typically challenging, but I am certain there are many SEO companies who will recognize the argument, but will ask for within the Thousands or else huge figures to do this crazy marketing and marketing purpose. http://smallbedroomlamps.webs.com/

The situation comes up

The situation comes up usually.Most individuals are used by SEO Suppliers, but some are also recognized by SEO Professional alternatives. discover this info here

If you are searching for

If you are searching for your website to position from the Top Ten seo result website for a particular key phrase or key terms then depend on spending while in the countless figures and countless figures, sometimes countless figures, for excellent, professional, and reliable SEO organizations, usually with regards to the competition from the keyword and key phrase and key phrase. this link

It’s appropriate time to

It’s appropriate time to make some plans for the future and it is time to be happy. I have read this post and if I could I wish to suggest you few interesting things or advice. Perhaps you could write next articles referring to this article. I desire to read even more things about it! her explanation

Those guidelines

Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition. check my source

Please don't are pleased

Please don't are pleased with InaffordableInches or Incheslow-cost", but be pleased with InchpowerfulIn and Intactic". binární opce demo

Make a list of some of

Make a list of some of better SEO services providers with the offered packages. Now do compare & contrast with the packages and select the one which suits your needs in an efficient way and brings long term result. see post

If you are thinking about on

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. http://bestbondingcompanies.blog.com/

I mean, the common content

I mean, the common content gets about 50 opinions at around a 5% - 10% ctr, which indicates that you're going to probably have to create between 7 - 10 content to get the variety of mouse clicks you'll need to turn a selling. trivia crack hack

Mark Henry

Good blog along with the excellent quality stuff and I’m sure this will be greatly helpful.Hajjtours

Thus, SEO freelancing has

Thus, SEO freelancing has become a significant trend within the current circumstance as most organizations need to draw in customers and increase their sales. blog here

SEO content could be

SEO content could be presented to an individualized blog site in addition to SEO write-up internet directories, that allow hyperlinks to your web page. https://martialartsschoolsnearme.wordpress.com/

SEO content could be

SEO content could be presented to an individualized blog site in addition to SEO write-up internet directories, that allow hyperlinks to your web page. https://martialartsschoolsnearme.wordpress.com/

Our improved Uk web page

Our improved Uk web page ratings suppliers allow your web page to accomplish higher volume of specific, prospective as well as sports convertible car visitors. click for more

NICE

That means that only

That means that only individuals who are interested in specific items or solutions will see your article, view you as an expert in the topic, and will check out your website. http://www.avantissa.com/

Oh no, database is very

Oh no, database is very difficult thing for me, >.<
penyebab gusi bengkakobat untuk gusi bengkakartikel tentang kesehatan

In addition to SEO, it is

In addition to SEO, it is also helpful when a website need a particular visitors on specific search phrases not used by SEO. why not try here

Thus, one really should not

Thus, one really should not be that picky however one really should not settle for just about any laptop computer qualities a questionable construction. http://workathomefast.jigsy.com/

When buying a laptop

When buying a laptop computer or laptop computer or computer, don't only think of your choices right now, take into consideration your prospective needs also. address

In relation to your current

In relation to your current gadgets, absolutely nothing is more dangerous while developing a pc recovery employment which has a comprehensive along with rapid while you might need to go back on-line associated with organization as well as customized purposes. http://posterprintingstyles.soup.io/

This was an excellent

This was an excellent article. It has some valuable content on this
topic. Thank you for compiling it into an easy to read and well written
post.

 James R Cash

By such as search phrases in

By such as search phrases in your material, when individuals are looking for details related to your niche and type those search phrases, your material and web page show up on google, therefore creating it easy for you to get a lot of visitors on your web page. sulfate free dandruff shampoo

Thanks for this post.

Thanks for this post.
your blog is very nice, interesting and so informative for distributor ultimate nutrition indonesia

Technological enhancements

Technological enhancements in communion with advent of internet make space for improved on the internet popularity.why not try here

Advertising is essen

Advertising is essential so that you can maintain a frequent stream  aye jual pupuk organik cair terbaik pupuk hantu jimmy click here of
leads that will buy items, solutions, and/or the income opportunity
gara jual buku tips cara agar cepat hamil muda click heresince prospective customers would be the center of any System promotion
prospect..

No more packed units and

No more packed units and packed drawers: you are providing yourself a larger workplace as a compensate for being intelligent and using a web-based invoice monitoring system! Whenever you need a particular papers, you will know where it is and that it can be recovered quickly. click for more

Keyword densities should

Keyword densities should never surpass 3-4% of your finish material. If it does, it may look like you're filling your site with more search phrases than useful information. http://upliftinggreatquotes.tumblr.com/

rika

thank you for some of these web articles is very impressive and qualified to compete obat kuat

It is also known as Expense

It is also known as Expense For each Just simply click (CPC), Compensated Placement and Online search search engines search motor Advertising. click to read

Here are seven content

Here are seven content marketing techniques that you can use to interact with your leads and shift them forward in their purchasing pattern. http://www.weightfactory.com/

This topic was really educational

This topic was really educational and nicely written. I approach to do some additional exploration on this. you should be giving information about it more. I must have to praise you for this extra ordinary piece of work. harga mobil Honda

Nice Post!

You made some good points there. I did a search on the topic and found most people will agree with your blog.
proxy server list 2015
web proxy list 2015
free proxy websites 2015

I think other web site

I think other web site proprietors should take this web site as an model, very clean and fantastic user friendly style and design, as well as the content. You are an expert in this topic! Your Bright Home

Powered by Drupal - Design by artinet