<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/ivy-report">
<xsl:text>
  /* limewire directed graph dot input file. 
     generated by ivy report */
digraph G {
    graph [colorscheme=
    node [color=lightblue2, style=filled];
</xsl:text>
  <!-- must list modules separately in case one is never used as a dependency. -->
  <xsl:for-each select="dependencies/module[@organisation='org.limewire'][@name!='mock-core']">
  <xsl:sort select="@name"/>
   	<xsl:text>    "</xsl:text><xsl:value-of select="@name"/><xsl:text>"
</xsl:text>
  </xsl:for-each>
  <!-- now must go through dependencies. -->
  <xsl:for-each select="dependencies/module[@organisation='org.limewire'][@name!='mock-core']/revision[not(@evicted)]/caller[@organisation='org.limewire'][@name!='mock-core']">
  <!-- sort in order to make .dot file readable in order of "i depend on 'these things'" -->
  <xsl:sort select="@name"/>
   	<xsl:text>    "</xsl:text><xsl:value-of select="@name"/><xsl:text>" -&gt; "</xsl:text><xsl:value-of select="../../@name"/><xsl:text>" </xsl:text>
   	<!-- THIS IS AWFUL - BUT I HAVE NO CLUE HOW TO DO IT IN XSL... 
   	     color names at: http://www.graphviz.org/doc/info/colors.html -->
   	<xsl:choose>
   	    <xsl:when test="@name='swingui'">
   	    <xsl:text>[color="hotpink"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='mojito-ui'">
   	    <xsl:text>[color="ivory4"];
</xsl:text>
        </xsl:when><xsl:when test="@name='core-glue'">
   	    <xsl:text>[color="khaki4"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='xmpp'">
   	    <xsl:text>[color="lavenderblush3"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='player'">
   	    <xsl:text>[color="lemonchiffon2"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='gnutella-core'">
   	    <xsl:text>[color="lightblue2"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='core-settings'">
   	    <xsl:text>[color="lightcyan1"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='promotion'">
   	    <xsl:text>[color="lightgoldenrod1"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='lwsserver'">
   	    <xsl:text>[color="lightgray"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='mojito'">
   	    <xsl:text>[color="lightpink3"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='statistic'">
   	    <xsl:text>[color="lightsalmon3"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='setting'">
   	    <xsl:text>[color="lightskyblue2"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='security'">
   	    <xsl:text>[color="lightslategrey"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='rudp'">
   	    <xsl:text>[color="lightsteelblue4"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='core-api'">
   	    <xsl:text>[color="lightyellow4"];
</xsl:text>
        </xsl:when>
        <xsl:when test="@name='player-api'">
   	    <xsl:text>[color="magenta2"];
</xsl:text>
        </xsl:when>        
        <xsl:when test="@name='swarm'">
   	    <xsl:text>[color="maroon2"];
</xsl:text>
        </xsl:when>        
        <xsl:when test="@name='http'">
   	    <xsl:text>[color="blue"];
</xsl:text>
        </xsl:when>        
        <xsl:when test="@name='xmpp-api'">
   	    <xsl:text>[color="mediumorchid"];
</xsl:text>
        </xsl:when>
        
        <xsl:when test="@name='net'">
   	    <xsl:text>[color="mediumpurple"];
</xsl:text>
        </xsl:when>        
        <xsl:when test="@name='nio'">
   	    <xsl:text>[color="mediumseagreen"];
</xsl:text>
        </xsl:when>              
        <xsl:when test="@name='collection'">
   	    <xsl:text>[color="midnightblue"];
</xsl:text>
        </xsl:when>      
        <xsl:when test="@name='io'">
   	    <xsl:text>[color="mistyrose3"];
</xsl:text>
        </xsl:when>      
        <xsl:when test="@name='common'">
   	    <xsl:text>[color="navajowhite2"];
</xsl:text>
        </xsl:when>      
        <xsl:when test="@name='geocode'">
   	    <xsl:text>[color="olivedrab4"];
</xsl:text>
        </xsl:when>   
        <xsl:when test="@name='integrated-ui'">
   	    <xsl:text>[color="orange4"];
</xsl:text>
        </xsl:when>   
        <xsl:otherwise>
   	    <xsl:text>;
</xsl:text>
        </xsl:otherwise>      
    </xsl:choose>
  </xsl:for-each>
<xsl:text>}</xsl:text>
</xsl:template>
</xsl:stylesheet>
